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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h
index 7a061a9..7cf0208 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