From 5081b5d3dafa11eb12a341b65b0d5b3f5d28572e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 7 Sep 2013 13:57:20 -0400 Subject: [PATCH] Workaround for compiling with /W4 warnings on Visual C++. --- include/SDL_assert.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/SDL_assert.h b/include/SDL_assert.h index 53ee9ba74182e..4329434064cad 100644 --- a/include/SDL_assert.h +++ b/include/SDL_assert.h @@ -86,8 +86,14 @@ This also solves the problem of... 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 @@ extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, } \ break; /* not retrying. */ \ } \ - } while (0) + } while (SDL_NULL_WHILE_LOOP_CONDITION) #endif /* enabled assertions support code */