src/SDL_assert.c
changeset 6759 b74da0b33530
parent 6621 25504f9ab078
child 6885 700f1b25f77f
child 8377 3a7e8110201e
equal deleted inserted replaced
6758:2a218048b45f 6759:b74da0b33530
   124 
   124 
   125 
   125 
   126 static SDL_assert_state
   126 static SDL_assert_state
   127 SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
   127 SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
   128 {
   128 {
       
   129 #ifdef __WIN32__
       
   130     #define ENDLINE "\r\n"
       
   131 #else
       
   132     #define ENDLINE "\n"
       
   133 #endif
       
   134 
   129     const char *envr;
   135     const char *envr;
   130     SDL_assert_state state = SDL_ASSERTION_ABORT;
   136     SDL_assert_state state = SDL_ASSERTION_ABORT;
   131     SDL_Window *window;
   137     SDL_Window *window;
   132     SDL_MessageBoxData messagebox;
   138     SDL_MessageBoxData messagebox;
   133     SDL_MessageBoxButtonData buttons[] = {
   139     SDL_MessageBoxButtonData buttons[] = {
   148     if (!message) {
   154     if (!message) {
   149         /* Uh oh, we're in real trouble now... */
   155         /* Uh oh, we're in real trouble now... */
   150         return SDL_ASSERTION_ABORT;
   156         return SDL_ASSERTION_ABORT;
   151     }
   157     }
   152     SDL_snprintf(message, SDL_MAX_LOG_MESSAGE,
   158     SDL_snprintf(message, SDL_MAX_LOG_MESSAGE,
   153                  "Assertion failure at %s (%s:%d), triggered %u %s:\r\n  '%s'",
   159                  "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE
       
   160                     "  '%s'",
   154                  data->function, data->filename, data->linenum,
   161                  data->function, data->filename, data->linenum,
   155                  data->trigger_count, (data->trigger_count == 1) ? "time" : "times",
   162                  data->trigger_count, (data->trigger_count == 1) ? "time" : "times",
   156                  data->condition);
   163                  data->condition);
   157 
   164 
   158     debug_print("\n\n%s\n\n", message);
   165     debug_print("\n\n%s\n\n", message);