We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3761 - Windows non-MinGW cmake build defines HAVE_WCSLCPY and HAVE_WCSLCAT
Summary: Windows non-MinGW cmake build defines HAVE_WCSLCPY and HAVE_WCSLCAT
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: don't know
Hardware: x86_64 Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-19 18:55 UTC by Tom Seddon
Modified: 2017-08-21 18:25 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Seddon 2017-08-19 18:55:11 UTC
https://github.com/SDL-mirror/SDL/commit/0f0ad62237fabb58d5811fe6fa59e5e5aa0e2fb5 (git head at the time of writing); Visual Studio 2015, toolset v140, Platform 10.0.14393.0, building for x64

Windows non-MinGW cmake build sets defines implying wcslcpy and wcslcat are available, but Windows doesn't have these functions.

The fix I've applied to my copy:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ed0f55..a811054 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -627,7 +627,7 @@ if(LIBC)
     set(HAVE_SIGNAL_H 1)
     foreach(_FN
             malloc calloc realloc free qsort abs memset memcpy memmove memcmp
-            wcslen wcslcpy wcslcat wcscmp
+            wcslen wcscmp
             strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
             _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
             _stricmp _strnicmp sscanf atan atan2 acos asin ceil copysign cos
Comment 1 Ryan C. Gordon 2017-08-21 06:41:16 UTC
That's weird, these are the exact two functions that Emscripten incorrectly believed it had until we upgraded the buildbot's emsdk install.

Not sure what's up with this, but it's possibly not a MingW-specific thing!

--ryan.
Comment 2 Sam Lantinga 2017-08-21 18:25:57 UTC
These functions aren't critical to use the C library versions when available, so I just pulled them from configure.

https://hg.libsdl.org/SDL/rev/d9f24e95e8ba

Thanks!