Workaround for compiling with /W4 warnings on Visual C++.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 07 Sep 2013 13:57:20 -0400
changeset 7736 84d89d60908f
parent 7735 eeba085802ca
child 7737 e9d463cb5b49
Workaround for compiling with /W4 warnings on Visual C++.
include/SDL_assert.h
--- a/include/SDL_assert.h	Sat Sep 07 13:47:14 2013 -0400
+++ b/include/SDL_assert.h	Sat Sep 07 13:57:20 2013 -0400
@@ -86,8 +86,14 @@
 disable assertions.
 */
 
+#ifdef _MSC_VER  /* stupid /W4 warnings. */
+#define SDL_NULL_WHILE_LOOP_CONDITION (-1 == __LINE__)
+#else
+#define SDL_NULL_WHILE_LOOP_CONDITION (0)
+#endif
+
 #define SDL_disabled_assert(condition) \
-    do { (void) sizeof ((condition)); } while (0)
+    do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
 
 typedef enum
 {
@@ -140,7 +146,7 @@
             } \
             break; /* not retrying. */ \
         } \
-    } while (0)
+    } while (SDL_NULL_WHILE_LOOP_CONDITION)
 
 #endif  /* enabled assertions support code */