cmocka: Fix printf integer formats.
authorAndreas Schneider <asn@cryptomilk.org>
Tue, 10 Feb 2015 09:53:32 +0000 (10:53 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 10 Feb 2015 14:49:30 +0000 (15:49 +0100)
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
src/cmocka.c

index 885cf33..c0a1bcf 100644 (file)
 WINBASEAPI BOOL WINAPI IsDebuggerPresent(VOID);
 
 #ifndef PRIdS
-#define PRIdS "Id"
+# define PRIdS "Id"
 #endif
 
 #ifndef PRIu64
-#define PRIu64 "I64u"
+# define PRIu64 "I64u"
+#endif
+
+#ifndef PRIuMAX
+# define PRIuMAX PRIu64
+#endif
+
+#ifndef PRIxMAX
+#define PRIxMAX "I64x"
+#endif
+
+#ifndef PRIXMAX
+#define PRIXMAX "I64X"
 #endif
 
 #else /* _WIN32 */
 
+#ifndef __PRI64_PREFIX
+# if __WORDSIZE == 64
+#  define __PRI64_PREFIX "l"
+# else
+#  define __PRI64_PREFIX "ll"
+# endif
+#endif
+
 #ifndef PRIdS
-#define PRIdS "zd"
+# define PRIdS "zd"
 #endif
 
 #ifndef PRIu64
-#define PRIu64 "llu"
+# define PRIu64 __PRI64_PREFIX "u"
+#endif
+
+#ifndef PRIuMAX
+# define PRIuMAX __PRI64_PREFIX "u"
+#endif
+
+#ifndef PRIxMAX
+#define PRIxMAX __PRI64_PREFIX "x"
+#endif
+
+#ifndef PRIXMAX
+#define PRIXMAX __PRI64_PREFIX "X"
 #endif
 
 #include <signal.h>