Skip to content

Commit

Permalink
Workaround for compiling with /W4 warnings on Visual C++.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 7, 2013
1 parent 83383c6 commit 5081b5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/SDL_assert.h
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 */

Expand Down

0 comments on commit 5081b5d

Please sign in to comment.