LZY_Log takes variable argument list
This commit is contained in:
parent
f2911ceebd
commit
cefa79506f
17
inc/lzy.h
17
inc/lzy.h
|
@ -108,7 +108,7 @@ int LZY_PollEvent(LZY_Event *);
|
|||
void LZY_CycleEvents(void);
|
||||
int LZY_KeyDown(unsigned int key);
|
||||
int LZY_ShouldQuit(void);
|
||||
void LZY_Log(const char *msg);
|
||||
void LZY_Log(const char *fmt, ...);
|
||||
const char *LZY_GetError(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -469,8 +469,8 @@ int LZY_ShouldQuit(void) {
|
|||
return should_quit;
|
||||
}
|
||||
|
||||
void LZY_Log(const char *msg) {
|
||||
LZY_UNUSED(msg);
|
||||
void LZY_Log(const char *fmt, ...) {
|
||||
LZY_UNUSED(fmt);
|
||||
}
|
||||
|
||||
const char *LZY_GetError(void) {
|
||||
|
@ -1050,8 +1050,15 @@ int LZY_ShouldQuit(void) {
|
|||
return should_quit;
|
||||
}
|
||||
|
||||
void LZY_Log(const char *msg) {
|
||||
SDL_Log("%s", msg);
|
||||
void LZY_Log(const char *fmt, ...) {
|
||||
char buf[2048] = {0};
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, sizeof(buf) - 1, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
SDL_Log("%s", buf);
|
||||
}
|
||||
|
||||
const char *LZY_GetError(void) {
|
||||
|
|
Loading…
Reference in New Issue