SDL_assertion messages use "\n" instead of "\r\n" on non-Windows platforms.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 16 Dec 2012 14:46:16 -0500
changeset 6759 b74da0b33530
parent 6758 2a218048b45f
child 6760 04dcce3081e6
child 8377 3a7e8110201e
SDL_assertion messages use "\n" instead of "\r\n" on non-Windows platforms.
src/SDL_assert.c
--- a/src/SDL_assert.c	Sun Dec 16 14:39:49 2012 -0500
+++ b/src/SDL_assert.c	Sun Dec 16 14:46:16 2012 -0500
@@ -126,6 +126,12 @@
 static SDL_assert_state
 SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
 {
+#ifdef __WIN32__
+    #define ENDLINE "\r\n"
+#else
+    #define ENDLINE "\n"
+#endif
+
     const char *envr;
     SDL_assert_state state = SDL_ASSERTION_ABORT;
     SDL_Window *window;
@@ -150,7 +156,8 @@
         return SDL_ASSERTION_ABORT;
     }
     SDL_snprintf(message, SDL_MAX_LOG_MESSAGE,
-                 "Assertion failure at %s (%s:%d), triggered %u %s:\r\n  '%s'",
+                 "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE
+                    "  '%s'",
                  data->function, data->filename, data->linenum,
                  data->trigger_count, (data->trigger_count == 1) ? "time" : "times",
                  data->condition);