Move in va_copy() define block from stdlib.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/src/SDL_internal.h b/src/SDL_internal.h
index 69da271..2ec32f6 100644
--- a/src/SDL_internal.h
+++ b/src/SDL_internal.h
@@ -26,6 +26,15 @@
#define _GNU_SOURCE
#endif
+/* Do our best to make sure va_copy is working */
+#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
+#elif defined(__GNUC__) && (__GNUC__ < 3)
+#define va_copy(dst, src) __va_copy(dst, src)
+#endif
+
/* This is for a variable-length array at the end of a struct:
struct x { int y; char z[SDL_VARIABLE_LENGTH_ARRAY]; };
Use this because GCC 2 needs different magic than other compilers. */
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
index 1331930..ae8f306 100644
--- a/src/stdlib/SDL_string.c
+++ b/src/stdlib/SDL_string.c
@@ -28,14 +28,6 @@
#include "SDL_stdinc.h"
-#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
-#elif defined(__GNUC__) && (__GNUC__ < 3)
-#define va_copy(to, from) __va_copy(to, from)
-#endif
-
#if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOL) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) || !defined(HAVE_STRTOLL) || !defined(HAVE_STRTOULL)
#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F'))
#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f'))