Patched stdlib changes to compile on Windows.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 09 Dec 2013 13:30:35 -0500
changeset 8092 46fb898f098d
parent 8091 a65f28a04224
child 8093 b43765095a6f
Patched stdlib changes to compile on Windows.
src/atomic/SDL_atomic.c
src/stdlib/SDL_getenv.c
src/stdlib/SDL_string.c
--- a/src/atomic/SDL_atomic.c	Mon Nov 25 00:11:52 2013 -0500
+++ b/src/atomic/SDL_atomic.c	Mon Dec 09 13:30:35 2013 -0500
@@ -152,7 +152,9 @@
 void*
 SDL_AtomicSetPtr(void **a, void *v)
 {
-#ifdef HAVE_MSC_ATOMICS
+#if defined(HAVE_MSC_ATOMICS) && (_M_IX86)
+    return (void *) _InterlockedExchange((long *)a, (long) v);
+#elif defined(HAVE_MSC_ATOMICS) && (!_M_IX86)
     return _InterlockedExchangePointer(a, v);
 #elif defined(HAVE_GCC_ATOMICS)
     return __sync_lock_test_and_set(a, v);
--- a/src/stdlib/SDL_getenv.c	Mon Nov 25 00:11:52 2013 -0500
+++ b/src/stdlib/SDL_getenv.c	Mon Dec 09 13:30:35 2013 -0500
@@ -26,13 +26,12 @@
 
 #include "SDL_stdinc.h"
 
-#if !defined(SDL_setenv) && defined(__WIN32__)
+#if defined(__WIN32__) && (!defined(HAVE_SETENV) || !defined(HAVE_GETENV))
 /* Note this isn't thread-safe! */
 static char *SDL_envmem = NULL; /* Ugh, memory leak */
 static size_t SDL_envmemlen = 0;
 #endif
 
-
 /* Put a variable into the environment */
 #if defined(HAVE_SETENV)
 int
--- a/src/stdlib/SDL_string.c	Mon Nov 25 00:11:52 2013 -0500
+++ b/src/stdlib/SDL_string.c	Mon Dec 09 13:30:35 2013 -0500
@@ -986,7 +986,7 @@
 }
 #else
 int
-SDL_vsscanf(const char *text, const char *fmt, ...)
+SDL_vsscanf(const char *text, const char *fmt, va_list ap)
 {
     int retval = 0;