From 483ea8b7b0712d8480887c08bf95523861f86c48 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 2 Mar 2015 21:36:45 -0500 Subject: [PATCH] Fixed SDL_PRI?64 for 64-bit Linux. 64-bit Linux uses a "long" instead of "long long" for 64-bit ints. Added a special-case this so SDL_PRI?64 doesn't trigger compiler warnings when used with SDL's 64-bit datatypes on 64-bit Linux. --- include/SDL_stdinc.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 7a061a9c8..7cf020841 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -173,6 +173,8 @@ typedef uint64_t Uint64; #define SDL_PRIs64 PRIs64 #elif defined(__WIN32__) #define SDL_PRIs64 "I64d" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIs64 "ld" #else #define SDL_PRIs64 "lld" #endif @@ -182,6 +184,8 @@ typedef uint64_t Uint64; #define SDL_PRIu64 PRIu64 #elif defined(__WIN32__) #define SDL_PRIu64 "I64u" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIu64 "lu" #else #define SDL_PRIu64 "llu" #endif @@ -191,6 +195,8 @@ typedef uint64_t Uint64; #define SDL_PRIx64 PRIx64 #elif defined(__WIN32__) #define SDL_PRIx64 "I64x" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIx64 "lx" #else #define SDL_PRIx64 "llx" #endif @@ -200,6 +206,8 @@ typedef uint64_t Uint64; #define SDL_PRIX64 PRIX64 #elif defined(__WIN32__) #define SDL_PRIX64 "I64X" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIX64 "lX" #else #define SDL_PRIX64 "llX" #endif