commit 9e211e646f9d51dc1372c9f3c8f47a78caf4f2a5
authorSam Lantinga <slouken@libsdl.org>
Sat, 21 Jun 2014 11:24:06 -0700
changeset 88830700ef83072a
parent 8882 4fc9e98413c3
child 8884 a13802298fdd
commit 9e211e646f9d51dc1372c9f3c8f47a78caf4f2a5
Author: Sam Clegg <sbc@chromium.org>
Date: Fri Jun 20 12:52:11 2014

Fix win32 build which was failing due to missing PRIs64.

This change adds definitions for the C99 PRIs16 and PRIu64
which are missing from <stdint.h> on at last win32 and
possibly other platforms.

These already existed in testgesture.c so I removed them
from there also.
include/SDL_stdinc.h
test/testgesture.c
     1.1 --- a/include/SDL_stdinc.h	Sat Jun 21 11:16:26 2014 -0700
     1.2 +++ b/include/SDL_stdinc.h	Sat Jun 21 11:24:06 2014 -0700
     1.3 @@ -165,6 +165,23 @@
     1.4  
     1.5  /* @} *//* Basic data types */
     1.6  
     1.7 +/* Make sure we have macros for printing 64 bit values.
     1.8 + * <stdint.h> should define these but this is not true all platforms.
     1.9 + * (for example win32) */
    1.10 +#ifndef PRIs64
    1.11 +#ifdef __WIN32__
    1.12 +#define PRIs64 "I64"
    1.13 +#else
    1.14 +#define PRIs64 "lld"
    1.15 +#endif
    1.16 +#endif
    1.17 +#ifndef PRIu64
    1.18 +#ifdef __WIN32__
    1.19 +#define PRIu64 "I64u"
    1.20 +#else
    1.21 +#define PRIu64 "llu"
    1.22 +#endif
    1.23 +#endif
    1.24  
    1.25  /* Annotations to help code analysis tools */
    1.26  #ifdef SDL_DISABLE_ANALYZE_MACROS
     2.1 --- a/test/testgesture.c	Sat Jun 21 11:16:26 2014 -0700
     2.2 +++ b/test/testgesture.c	Sat Jun 21 11:24:06 2014 -0700
     2.3 @@ -22,28 +22,6 @@
     2.4  #include "SDL_touch.h"
     2.5  #include "SDL_gesture.h"
     2.6  
     2.7 -/* Make sure we have good macros for printing 32 and 64 bit values */
     2.8 -#ifndef PRIs32
     2.9 -#define PRIs32 "d"
    2.10 -#endif
    2.11 -#ifndef PRIu32
    2.12 -#define PRIu32 "u"
    2.13 -#endif
    2.14 -#ifndef PRIs64
    2.15 -#ifdef __WIN32__
    2.16 -#define PRIs64 "I64"
    2.17 -#else
    2.18 -#define PRIs64 "lld"
    2.19 -#endif
    2.20 -#endif
    2.21 -#ifndef PRIu64
    2.22 -#ifdef __WIN32__
    2.23 -#define PRIu64 "I64u"
    2.24 -#else
    2.25 -#define PRIu64 "llu"
    2.26 -#endif
    2.27 -#endif
    2.28 -
    2.29  #define WIDTH 640
    2.30  #define HEIGHT 480
    2.31  #define BPP 4