Patched stdlib changes to compile on Windows.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 09 Dec 2013 13:30:35 -0500
changeset 809246fb898f098d
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
     1.1 --- a/src/atomic/SDL_atomic.c	Mon Nov 25 00:11:52 2013 -0500
     1.2 +++ b/src/atomic/SDL_atomic.c	Mon Dec 09 13:30:35 2013 -0500
     1.3 @@ -152,7 +152,9 @@
     1.4  void*
     1.5  SDL_AtomicSetPtr(void **a, void *v)
     1.6  {
     1.7 -#ifdef HAVE_MSC_ATOMICS
     1.8 +#if defined(HAVE_MSC_ATOMICS) && (_M_IX86)
     1.9 +    return (void *) _InterlockedExchange((long *)a, (long) v);
    1.10 +#elif defined(HAVE_MSC_ATOMICS) && (!_M_IX86)
    1.11      return _InterlockedExchangePointer(a, v);
    1.12  #elif defined(HAVE_GCC_ATOMICS)
    1.13      return __sync_lock_test_and_set(a, v);
     2.1 --- a/src/stdlib/SDL_getenv.c	Mon Nov 25 00:11:52 2013 -0500
     2.2 +++ b/src/stdlib/SDL_getenv.c	Mon Dec 09 13:30:35 2013 -0500
     2.3 @@ -26,13 +26,12 @@
     2.4  
     2.5  #include "SDL_stdinc.h"
     2.6  
     2.7 -#if !defined(SDL_setenv) && defined(__WIN32__)
     2.8 +#if defined(__WIN32__) && (!defined(HAVE_SETENV) || !defined(HAVE_GETENV))
     2.9  /* Note this isn't thread-safe! */
    2.10  static char *SDL_envmem = NULL; /* Ugh, memory leak */
    2.11  static size_t SDL_envmemlen = 0;
    2.12  #endif
    2.13  
    2.14 -
    2.15  /* Put a variable into the environment */
    2.16  #if defined(HAVE_SETENV)
    2.17  int
     3.1 --- a/src/stdlib/SDL_string.c	Mon Nov 25 00:11:52 2013 -0500
     3.2 +++ b/src/stdlib/SDL_string.c	Mon Dec 09 13:30:35 2013 -0500
     3.3 @@ -986,7 +986,7 @@
     3.4  }
     3.5  #else
     3.6  int
     3.7 -SDL_vsscanf(const char *text, const char *fmt, ...)
     3.8 +SDL_vsscanf(const char *text, const char *fmt, va_list ap)
     3.9  {
    3.10      int retval = 0;
    3.11