Add SDL_asprintf and SDL_vasprintf

This commit is contained in:
Cameron Cawley
2021-09-14 20:37:35 +01:00
committed by Sam Lantinga
parent 79b0aae86c
commit 25a614bc3e
5 changed files with 70 additions and 0 deletions

View File

@@ -89,6 +89,12 @@ static void SDL_InitDynamicAPI(void);
va_end(ap); \
return retval; \
} \
_static int SDLCALL SDL_asprintf##name(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
int retval; va_list ap; initcall; va_start(ap, fmt); \
retval = jump_table.SDL_vasprintf(strp, fmt, ap); \
va_end(ap); \
return retval; \
} \
_static void SDLCALL SDL_Log##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
va_list ap; initcall; va_start(ap, fmt); \
jump_table.SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); \