diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c index eddd9a99eb..a55f2ad845 100644 --- a/frontend/drivers/platform_unix.c +++ b/frontend/drivers/platform_unix.c @@ -2125,7 +2125,7 @@ static uint64_t frontend_unix_get_mem_total(void) while (fgets(line, sizeof(line), data)) { - if (sscanf(line, "MemTotal: " STRING_REP_ULONG " kB", (size_t*)&total) == 1) + if (sscanf(line, "MemTotal: " STRING_REP_USIZE " kB", (size_t*)&total) == 1) { fclose(data); total *= 1024; @@ -2150,13 +2150,13 @@ static uint64_t frontend_unix_get_mem_used(void) while (fgets(line, sizeof(line), data)) { - if (sscanf(line, "MemTotal: " STRING_REP_ULONG " kB", (size_t*)&total) == 1) + if (sscanf(line, "MemTotal: " STRING_REP_USIZE " kB", (size_t*)&total) == 1) total *= 1024; - if (sscanf(line, "MemFree: " STRING_REP_ULONG " kB", (size_t*)&freemem) == 1) + if (sscanf(line, "MemFree: " STRING_REP_USIZE " kB", (size_t*)&freemem) == 1) freemem *= 1024; - if (sscanf(line, "Buffers: " STRING_REP_ULONG " kB", (size_t*)&buffers) == 1) + if (sscanf(line, "Buffers: " STRING_REP_USIZE " kB", (size_t*)&buffers) == 1) buffers *= 1024; - if (sscanf(line, "Cached: " STRING_REP_ULONG " kB", (size_t*)&cached) == 1) + if (sscanf(line, "Cached: " STRING_REP_USIZE " kB", (size_t*)&cached) == 1) cached *= 1024; } diff --git a/gfx/video_driver.c b/gfx/video_driver.c index efef358ce1..55b09f36fd 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/libretro-common/include/retro_common_api.h b/libretro-common/include/retro_common_api.h index 38b6773970..536810c0c9 100644 --- a/libretro-common/include/retro_common_api.h +++ b/libretro-common/include/retro_common_api.h @@ -78,15 +78,15 @@ typedef int ssize_t; #ifdef _WIN32 #define STRING_REP_INT64 "%I64u" #define STRING_REP_UINT64 "%I64u" -#define STRING_REP_ULONG "%Iu" +#define STRING_REP_USIZE "%Iu" #elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA) && !defined(WIIU) #define STRING_REP_INT64 "%llu" #define STRING_REP_UINT64 "%llu" -#define STRING_REP_ULONG "%zu" +#define STRING_REP_USIZE "%zu" #else #define STRING_REP_INT64 "%llu" #define STRING_REP_UINT64 "%llu" -#define STRING_REP_ULONG "%lu" +#define STRING_REP_USIZE "%lu" #endif /* diff --git a/network/httpserver/httpserver.c b/network/httpserver/httpserver.c index b996aed4aa..050604d0e6 100644 --- a/network/httpserver/httpserver.c +++ b/network/httpserver/httpserver.c @@ -523,10 +523,10 @@ static int httpserver_handle_get_mmap(struct mg_connection* conn, void* cbdata) mg_printf(conn, "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n"); mg_printf(conn, "{" - "\"start\":" STRING_REP_ULONG "," - "\"length\":" STRING_REP_ULONG "," + "\"start\":" STRING_REP_USIZE "," + "\"length\":" STRING_REP_USIZE "," "\"compression\":\"deflate\"," - "\"compressedLength\":" STRING_REP_ULONG "," + "\"compressedLength\":" STRING_REP_USIZE "," "\"encoding\":\"Z85\"," "\"data\":\"%s\"" "}", diff --git a/tasks/task_database.c b/tasks/task_database.c index 0a6b1ee595..908dfc2f5b 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -217,14 +217,9 @@ static int task_database_iterate_start(database_info_handle_t *db, msg[0] = msg[510] = '\0'; snprintf(msg, sizeof(msg), - STRING_REP_ULONG "/" STRING_REP_ULONG ": %s %s...\n", -#if defined(_WIN32) || defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA) &&!defined(WIIU) - db->list_ptr, - db->list->size, -#else - (unsigned long)db->list_ptr, - (unsigned long)db->list->size, -#endif + STRING_REP_USIZE "/" STRING_REP_USIZE ": %s %s...\n", + (size_t)db->list_ptr, + (size_t)db->list->size, msg_hash_to_str(MSG_SCANNING), name);