4 #include <SDL2/SDL_log.h>
9 void __attribute__ ((format (printf, 1, 2))) _print_info(const char *format, ...)
12 va_start(args, format);
14 SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, format, args);
19 void __attribute__ ((format (printf, 3, 4))) _print_error(const char *_file, int _line, const char *format, ...)
22 va_start(args, format);
25 char title[123], text[1234];
26 snprintf(title, sizeof(title), "Error in %s line %d:\n", _file, _line);
27 title[sizeof(title) - 1] = '\0';
28 vsnprintf(text, sizeof(text), format, args);
29 text[sizeof(text) - 1] = '\0';
30 MessageBox(NULL, text, title, MB_OK);
32 SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "Error in %s line %d:\n", _file, _line);
33 SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, format, args);