Changed local var names in SDL assert macro.

Otherwise, if someone added an assert to a function that has a variable
named "state", the compiler might warn about shadowing a local.
This commit is contained in:
Ryan C. Gordon 2014-07-28 10:54:25 -04:00
parent 164de2325e
commit 0c09ce2b34
1 changed files with 4 additions and 7 deletions

View File

@ -141,16 +141,13 @@ extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *,
#define SDL_enabled_assert(condition) \ #define SDL_enabled_assert(condition) \
do { \ do { \
while ( !(condition) ) { \ while ( !(condition) ) { \
static struct SDL_assert_data assert_data = { \ static struct SDL_assert_data sdl_assert_data = { \
0, 0, #condition, 0, 0, 0, 0 \ 0, 0, #condition, 0, 0, 0, 0 \
}; \ }; \
const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \ const SDL_assert_state sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
SDL_FUNCTION, \ if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
SDL_FILE, \
SDL_LINE); \
if (state == SDL_ASSERTION_RETRY) { \
continue; /* go again. */ \ continue; /* go again. */ \
} else if (state == SDL_ASSERTION_BREAK) { \ } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
SDL_TriggerBreakpoint(); \ SDL_TriggerBreakpoint(); \
} \ } \
break; /* not retrying. */ \ break; /* not retrying. */ \