Fixed gcc warnings for apps using SDL headers with -Wundef flag.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 06 Jun 2011 12:20:04 -0400
changeset 55522167a41feefe
parent 5548 8f0abb6ef37d
child 5553 418675ebba17
Fixed gcc warnings for apps using SDL headers with -Wundef flag.

Fixes Bugzilla #1216.

Thanks to Dimitris Zenios for the patch!
include/SDL_assert.h
include/SDL_atomic.h
     1.1 --- a/include/SDL_assert.h	Sat Jun 04 15:26:02 2011 -0400
     1.2 +++ b/include/SDL_assert.h	Mon Jun 06 12:20:04 2011 -0400
     1.3 @@ -53,7 +53,7 @@
     1.4  /* Don't include intrin.h here because it contains C++ code */
     1.5  extern void __cdecl __debugbreak(void);
     1.6      #define SDL_TriggerBreakpoint() __debugbreak()
     1.7 -#elif (defined(__GNUC__) && ((__i386__) || (__x86_64__)))
     1.8 +#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
     1.9      #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
    1.10  #elif defined(HAVE_SIGNAL_H)
    1.11      #include <signal.h>
    1.12 @@ -63,7 +63,7 @@
    1.13      #define SDL_TriggerBreakpoint()
    1.14  #endif
    1.15  
    1.16 -#if (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
    1.17 +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
    1.18  #   define SDL_FUNCTION __func__
    1.19  #elif ((__GNUC__ >= 2) || defined(_MSC_VER))
    1.20  #   define SDL_FUNCTION __FUNCTION__
     2.1 --- a/include/SDL_atomic.h	Sat Jun 04 15:26:02 2011 -0400
     2.2 +++ b/include/SDL_atomic.h	Mon Jun 06 12:20:04 2011 -0400
     2.3 @@ -140,7 +140,7 @@
     2.4  /* Platform specific optimized versions of the atomic functions,
     2.5   * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
     2.6   */
     2.7 -#if SDL_ATOMIC_DISABLED
     2.8 +#if defined(SDL_ATOMIC_DISABLED) && SDL_ATOMIC_DISABLED
     2.9  #define SDL_DISABLE_ATOMIC_INLINE
    2.10  #endif
    2.11  #ifndef SDL_DISABLE_ATOMIC_INLINE