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

Summary: Windows non-MinGW cmake build defines HAVE_WCSLCPY and HAVE_WCSLCAT
Product: SDL Reporter: Tom Seddon <bugzilla.libsdl.org>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: don't know   
Hardware: x86_64   
OS: Windows 10   

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!