Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h
index c47ea4c..78d3402 100644
--- a/include/SDL_stdinc.h
+++ b/include/SDL_stdinc.h
@@ -168,18 +168,22 @@ typedef uint64_t Uint64;
/* 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
diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c
index b4ad596..cfd8d2a 100644
--- a/src/test/SDL_test_harness.c
+++ b/src/test/SDL_test_harness.c
@@ -564,7 +564,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
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) {
diff --git a/test/testgesture.c b/test/testgesture.c
index 89f5f36..f6658db 100644
--- a/test/testgesture.c
+++ b/test/testgesture.c
@@ -244,19 +244,19 @@ int main(int argc, char* argv[])
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 @@ int main(int argc, char* argv[])
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;
}
}