Fixed SDL_PRI?64 for 64-bit Linux.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 02 Mar 2015 21:36:45 -0500
changeset 93760495816fec54
parent 9375 bc00287b414f
child 9377 4c29dc2baaa8
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
     1.1 --- a/include/SDL_stdinc.h	Mon Mar 02 11:43:24 2015 -0800
     1.2 +++ b/include/SDL_stdinc.h	Mon Mar 02 21:36:45 2015 -0500
     1.3 @@ -173,6 +173,8 @@
     1.4  #define SDL_PRIs64 PRIs64
     1.5  #elif defined(__WIN32__)
     1.6  #define SDL_PRIs64 "I64d"
     1.7 +#elif defined(__LINUX__) && defined(__LP64__)
     1.8 +#define SDL_PRIs64 "ld"
     1.9  #else
    1.10  #define SDL_PRIs64 "lld"
    1.11  #endif
    1.12 @@ -182,6 +184,8 @@
    1.13  #define SDL_PRIu64 PRIu64
    1.14  #elif defined(__WIN32__)
    1.15  #define SDL_PRIu64 "I64u"
    1.16 +#elif defined(__LINUX__) && defined(__LP64__)
    1.17 +#define SDL_PRIu64 "lu"
    1.18  #else
    1.19  #define SDL_PRIu64 "llu"
    1.20  #endif
    1.21 @@ -191,6 +195,8 @@
    1.22  #define SDL_PRIx64 PRIx64
    1.23  #elif defined(__WIN32__)
    1.24  #define SDL_PRIx64 "I64x"
    1.25 +#elif defined(__LINUX__) && defined(__LP64__)
    1.26 +#define SDL_PRIx64 "lx"
    1.27  #else
    1.28  #define SDL_PRIx64 "llx"
    1.29  #endif
    1.30 @@ -200,6 +206,8 @@
    1.31  #define SDL_PRIX64 PRIX64
    1.32  #elif defined(__WIN32__)
    1.33  #define SDL_PRIX64 "I64X"
    1.34 +#elif defined(__LINUX__) && defined(__LP64__)
    1.35 +#define SDL_PRIX64 "lX"
    1.36  #else
    1.37  #define SDL_PRIX64 "llX"
    1.38  #endif