mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 17:05:36 +00:00
Merge commit 'f815580dde2de9667af5ca8b43f9590f2fac1aab' into main
This commit is contained in:
commit
3adf6bacd3
|
@ -73,13 +73,17 @@ static void SDL_InitDynamicAPI(void);
|
||||||
_static int SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
|
_static int SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
|
||||||
char buf[128], *str = buf; \
|
char buf[128], *str = buf; \
|
||||||
int result; \
|
int result; \
|
||||||
va_list ap; initcall; va_start(ap, fmt); \
|
va_list ap; initcall; \
|
||||||
|
va_start(ap, fmt); \
|
||||||
result = jump_table.SDL_vsnprintf(buf, sizeof(buf), fmt, ap); \
|
result = jump_table.SDL_vsnprintf(buf, sizeof(buf), fmt, ap); \
|
||||||
|
va_end(ap); \
|
||||||
if (result >= 0 && (size_t)result >= sizeof(buf)) { \
|
if (result >= 0 && (size_t)result >= sizeof(buf)) { \
|
||||||
size_t len = (size_t)result + 1; \
|
size_t len = (size_t)result + 1; \
|
||||||
str = (char *)jump_table.SDL_malloc(len); \
|
str = (char *)jump_table.SDL_malloc(len); \
|
||||||
if (str) { \
|
if (str) { \
|
||||||
|
va_start(ap, fmt); \
|
||||||
result = jump_table.SDL_vsnprintf(str, len, fmt, ap); \
|
result = jump_table.SDL_vsnprintf(str, len, fmt, ap); \
|
||||||
|
va_end(ap); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
va_end(ap); \
|
va_end(ap); \
|
||||||
|
|
Loading…
Reference in a new issue