diff th_types.h @ 395:bffd3caf2d2c

Rename TH_PRI{u,d,x}* macros to match with standard ISO C99 inttypes.h PRI*. This breaks the API again. Hooray.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 03 Mar 2016 14:13:31 +0200
parents 7df5991a0ed3
children 337f224b99fd
line wrap: on
line diff
--- a/th_types.h	Thu Mar 03 14:11:57 2016 +0200
+++ b/th_types.h	Thu Mar 03 14:13:31 2016 +0200
@@ -58,15 +58,17 @@
 // If so, set some printf specifiers
 #if TH_ARCH == 32
 #  define TH_ARCH_32BIT    1
-#  define TH_PRIu32        "u"
-#  define TH_PRId32        "d"
-#  define TH_PRIx32        "x"
-#  define TH_PRIu64        "llu"
-#  define TH_PRId64        "lld"
-#  define TH_PRIx64        "llx"
-#  define TH_PRIu_SIZE_T   "u"
-#  define TH_PRId_SSIZE_T  "d"
-#  define TH_PRIx_SIZE_T   "x"
+#  ifndef HAVE_INTTYPES_H
+#    define PRIu32        "u"
+#    define PRId32        "d"
+#    define PRIx32        "x"
+#    define PRIu64        "llu"
+#    define PRId64        "lld"
+#    define PRIx64        "llx"
+#  endif
+#  define PRIu_SIZE_T     "u"
+#  define PRId_SSIZE_T    "d"
+#  define PRIx_SIZE_T     "x"
 #  ifndef TH_PTRSIZE
 #    define TH_PTRSIZE 32
 #  endif
@@ -75,15 +77,17 @@
 #  endif
 #elif TH_ARCH == 64
 #  define TH_ARCH_64BIT    1
-#  define TH_PRIu32        "u"
-#  define TH_PRId32        "d"
-#  define TH_PRIx32        "x"
-#  define TH_PRIu64        "lu"
-#  define TH_PRId64        "ld"
-#  define TH_PRIx64        "lx"
-#  define TH_PRIu_SIZE_T   "lu"
-#  define TH_PRId_SSIZE_T  "ld"
-#  define TH_PRIx_SIZE_T   "lx"
+#  ifndef HAVE_INTTYPES_H
+#    define PRIu32        "u"
+#    define PRId32        "d"
+#    define PRIx32        "x"
+#    define PRIu64        "lu"
+#    define PRId64        "ld"
+#    define PRIx64        "lx"
+#  endif
+#  define PRIu_SIZE_T     "lu"
+#  define PRId_SSIZE_T    "ld"
+#  define PRIx_SIZE_T     "lx"
 #  ifndef TH_PTRSIZE
 #    define TH_PTRSIZE 64
 #  endif