Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404406
This commit is contained in:
Sam Lantinga 2010-01-13 08:25:16 +00:00
parent 803375d590
commit 89f83fd92e
2 changed files with 58 additions and 32 deletions

View file

@ -265,7 +265,7 @@ static SDL_assert_state SDL_PromptAssertion(const SDL_assert_data *data)
data->trigger_count, (data->trigger_count == 1) ? "" : "s",
data->condition);
/* let env. variable override, so unit tests won't block in a GUI. */
/* let env. variable override, so unit tests won't block in a GUI. */
envr = SDL_getenv("SDL_ASSERT");
if (envr != NULL) {
if (SDL_strcmp(envr, "abort") == 0) {
@ -327,7 +327,8 @@ static SDL_assert_state SDL_PromptAssertion(const SDL_assert_data *data)
static SDL_mutex *assertion_mutex = NULL;
SDL_assert_state
SDL_ReportAssertion(SDL_assert_data *data, const char *func, int line)
SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file,
int line)
{
SDL_assert_state state;
@ -338,7 +339,8 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, int line)
/* doing this because Visual C is upset over assigning in the macro. */
if (data->trigger_count == 0) {
data->function = func;
data->linenum = line;
data->filename = file;
data->linenum = line;
}
SDL_AddAssertionToReport(data);