From 130984f52889f26121d54d7b1feecc15700a0f7a Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Fri, 2 Aug 2019 18:51:32 +0800 Subject: Use retro_log for SysPrintf --- frontend/libretro.c | 12 ++++++++++++ frontend/main.c | 2 ++ 2 files changed, 14 insertions(+) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index e48069a..b8d17ab 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -2286,3 +2286,15 @@ int usleep (unsigned long us) sceKernelDelayThread(us); } #endif + +void SysPrintf(const char *fmt, ...) { + va_list list; + char msg[512]; + + va_start(list, fmt); + vsprintf(msg, fmt, list); + va_end(list); + + if (log_cb) + log_cb(RETRO_LOG_INFO, "%s", msg); +} diff --git a/frontend/main.c b/frontend/main.c index 860dec0..c0bfd0f 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -795,6 +795,7 @@ int emu_load_state(int slot) return LoadState(fname); } +#ifndef HAVE_LIBRETRO #ifndef ANDROID void SysPrintf(const char *fmt, ...) { @@ -819,6 +820,7 @@ void SysPrintf(const char *fmt, ...) { } #endif +#endif /* HAVE_LIBRETRO */ void SysMessage(const char *fmt, ...) { va_list list; -- cgit v1.2.3 From 0f288b5c9f0e792466a2e785e3090cd65f17c2de Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Fri, 2 Aug 2019 19:06:03 +0800 Subject: Silence warning: missing braces around initializer --- frontend/libretro_core_options.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h index bdc214f..6513e1c 100644 --- a/frontend/libretro_core_options.h +++ b/frontend/libretro_core_options.h @@ -663,7 +663,7 @@ struct retro_core_option_definition option_defs_us[] = { }, #endif /* DRC_DISABLE */ - { NULL, NULL, NULL, { NULL, NULL }, NULL }, + { NULL, NULL, NULL, { {0} }, NULL }, }; /* RETRO_LANGUAGE_JAPANESE */ @@ -1183,7 +1183,7 @@ struct retro_core_option_definition option_defs_tr[] = { }, #endif /* DRC_DISABLE */ - { NULL, NULL, NULL, { NULL, NULL }, NULL }, + { NULL, NULL, NULL, { {0} }, NULL }, }; -- cgit v1.2.3