Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings
authorSam Lantinga <slouken@libsdl.org>
Mon, 23 Jun 2014 11:06:50 -0700
changeset 8917 23182cf59f1c
parent 8916 96d944f74851
child 8919 c9be8299ba6b
Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings
include/SDL_stdinc.h
src/test/SDL_test_harness.c
test/testgesture.c
--- a/include/SDL_stdinc.h	Mon Jun 23 10:09:15 2014 -0700
+++ b/include/SDL_stdinc.h	Mon Jun 23 11:06:50 2014 -0700
@@ -168,18 +168,22 @@
 /* Make sure we have macros for printing 64 bit values.
  * <stdint.h> should define these but this is not true all platforms.
  * (for example win32) */
-#ifndef PRIs64
-#ifdef __WIN32__
-#define PRIs64 "I64"
+#ifndef SDL_PRIs64
+#ifdef PRIs64
+#define SDL_PRIs64 PRIs64
+#elif defined(__WIN32__)
+#define SDL_PRIs64 "I64"
 #else
-#define PRIs64 "lld"
+#define SDL_PRIs64 "lld"
 #endif
 #endif
-#ifndef PRIu64
-#ifdef __WIN32__
-#define PRIu64 "I64u"
+#ifndef SDL_PRIu64
+#ifdef PRIu64
+#define SDL_PRIu64 PRIu64
+#elif defined(__WIN32__)
+#define SDL_PRIu64 "I64u"
 #else
-#define PRIu64 "llu"
+#define SDL_PRIu64 "llu"
 #endif
 #endif
 
--- a/src/test/SDL_test_harness.c	Mon Jun 23 10:09:15 2014 -0700
+++ b/src/test/SDL_test_harness.c	Mon Jun 23 11:06:50 2014 -0700
@@ -564,7 +564,7 @@
                             execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter);
                         }
 
-                        SDLTest_Log("Test Iteration %i: execKey %" PRIu64, iterationCounter, execKey);
+                        SDLTest_Log("Test Iteration %i: execKey %" SDL_PRIu64, iterationCounter, execKey);
                         testResult = SDLTest_RunTest(testSuite, testCase, execKey);
 
                         if (testResult == TEST_RESULT_PASSED) {
--- a/test/testgesture.c	Mon Jun 23 10:09:15 2014 -0700
+++ b/test/testgesture.c	Mon Jun 23 11:06:50 2014 -0700
@@ -244,19 +244,19 @@
         break;
       case SDL_FINGERMOTION:
 #if VERBOSE
-        SDL_Log("Finger: %"PRIs64",x: %f, y: %f",event.tfinger.fingerId,
+        SDL_Log("Finger: %"SDL_PRIs64",x: %f, y: %f",event.tfinger.fingerId,
                event.tfinger.x,event.tfinger.y);
 #endif
         break;
       case SDL_FINGERDOWN:
 #if VERBOSE
-        SDL_Log("Finger: %"PRIs64" down - x: %f, y: %f",
+        SDL_Log("Finger: %"SDL_PRIs64" down - x: %f, y: %f",
            event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
 #endif
         break;
       case SDL_FINGERUP:
 #if VERBOSE
-        SDL_Log("Finger: %"PRIs64" up - x: %f, y: %f",
+        SDL_Log("Finger: %"SDL_PRIs64" up - x: %f, y: %f",
                event.tfinger.fingerId,event.tfinger.x,event.tfinger.y);
 #endif
         break;
@@ -275,12 +275,12 @@
         knob.r += event.mgesture.dDist;
         break;
       case SDL_DOLLARGESTURE:
-        SDL_Log("Gesture %"PRIs64" performed, error: %f",
+        SDL_Log("Gesture %"SDL_PRIs64" performed, error: %f",
            event.dgesture.gestureId,
            event.dgesture.error);
         break;
       case SDL_DOLLARRECORD:
-        SDL_Log("Recorded gesture: %"PRIs64"",event.dgesture.gestureId);
+        SDL_Log("Recorded gesture: %"SDL_PRIs64"",event.dgesture.gestureId);
         break;
       }
       }