Workaround for compiling with /W4 warnings on Visual C++.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 07 Sep 2013 13:57:20 -0400
changeset 773684d89d60908f
parent 7735 eeba085802ca
child 7737 e9d463cb5b49
Workaround for compiling with /W4 warnings on Visual C++.
include/SDL_assert.h
     1.1 --- a/include/SDL_assert.h	Sat Sep 07 13:47:14 2013 -0400
     1.2 +++ b/include/SDL_assert.h	Sat Sep 07 13:57:20 2013 -0400
     1.3 @@ -86,8 +86,14 @@
     1.4  disable assertions.
     1.5  */
     1.6  
     1.7 +#ifdef _MSC_VER  /* stupid /W4 warnings. */
     1.8 +#define SDL_NULL_WHILE_LOOP_CONDITION (-1 == __LINE__)
     1.9 +#else
    1.10 +#define SDL_NULL_WHILE_LOOP_CONDITION (0)
    1.11 +#endif
    1.12 +
    1.13  #define SDL_disabled_assert(condition) \
    1.14 -    do { (void) sizeof ((condition)); } while (0)
    1.15 +    do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
    1.16  
    1.17  typedef enum
    1.18  {
    1.19 @@ -140,7 +146,7 @@
    1.20              } \
    1.21              break; /* not retrying. */ \
    1.22          } \
    1.23 -    } while (0)
    1.24 +    } while (SDL_NULL_WHILE_LOOP_CONDITION)
    1.25  
    1.26  #endif  /* enabled assertions support code */
    1.27