Commit 4ec259a7848de6037a44e39409db8e487674502e

Sam Lantinga 2021-09-22T19:06:11

Fixed building on Visual Studio 2013 and older

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
index cb0b846..ab6e947 100644
--- a/src/stdlib/SDL_string.c
+++ b/src/stdlib/SDL_string.c
@@ -28,10 +28,14 @@
 
 #include "SDL_stdinc.h"
 
-#if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOL) || !defined(HAVE_STRTOUL)  || !defined(HAVE_STRTOLL) || !defined(HAVE_STRTOULL) || !defined(HAVE_STRTOD)
+#if defined(_MSC_VER) && _MSC_VER <= 1800
+/* Visual Studio 2013 tries to link with _vacopy in the C runtime. Newer versions do an inline assignment */
+#undef va_copy
+#define va_copy(dst, src)   dst = src
+#endif
+
 #define SDL_isupperhex(X)   (((X) >= 'A') && ((X) <= 'F'))
 #define SDL_islowerhex(X)   (((X) >= 'a') && ((X) <= 'f'))
-#endif
 
 #define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4)
 #define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF)