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