| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | #include "SDL_log.h" |
| | | #include "SDL_error.h" |
| | | #include "SDL_error_c.h" |
| | | |
| | | |
| | | /* Routine to get the thread-specific error variable */ |
| | | #if SDL_THREADS_DISABLED |
| | | /* The default (non-thread-safe) global error variable */ |
| | | static SDL_error SDL_global_error; |
| | | #define SDL_GetErrBuf() (&SDL_global_error) |
| | | #else |
| | | extern SDL_error *SDL_GetErrBuf(void); |
| | | #endif /* SDL_THREADS_DISABLED */ |
| | | |
| | | #define SDL_ERRBUFIZE 1024 |
| | | |
| | |
| | | case 0: /* Malformed format string.. */ |
| | | --fmt; |
| | | break; |
| | | case 'i': case 'd': case 'u': |
| | | case 'i': case 'd': case 'u': case 'x': case 'X': |
| | | error->args[error->argc++].value_l = va_arg(ap, long); |
| | | break; |
| | | } |
| | |
| | | *spot++ = *fmt++; |
| | | *spot++ = '\0'; |
| | | switch (spot[-2]) { |
| | | case 'i': case 'd': case 'u': |
| | | case 'i': case 'd': case 'u': case 'x': case 'X': |
| | | len = SDL_snprintf(msg, maxlen, tmp, |
| | | error->args[argi++].value_l); |
| | | if (len > 0) { |