Skip to content

Commit

Permalink
Another attempt to make MSVC's /W4 warning level cooperate with SDL_a…
Browse files Browse the repository at this point in the history
…ssert.

Fixes Bugzilla #2733.
  • Loading branch information
icculus committed Apr 7, 2015
1 parent a4458a7 commit 3e9c2e7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions include/SDL_assert.h
Expand Up @@ -86,11 +86,9 @@ 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
/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
this condition isn't constant. And looks like an owl's face! */
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)

#define SDL_disabled_assert(condition) \
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
Expand Down

0 comments on commit 3e9c2e7

Please sign in to comment.