diff src/SDL_assert.c @ 3655:1cc7f0143c12

Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE
author Sam Lantinga <slouken@libsdl.org>
date Wed, 13 Jan 2010 08:25:16 +0000
parents cb5b1aedb5a7
children f17ea6f49745
line wrap: on
line diff
--- a/src/SDL_assert.c	Wed Jan 13 08:06:32 2010 +0000
+++ b/src/SDL_assert.c	Wed Jan 13 08:25:16 2010 +0000
@@ -265,7 +265,7 @@
                 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_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 @@
     /* 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);