summaryrefslogtreecommitdiff
path: root/include/compat.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-01 21:55:17 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-01 22:34:45 +0100
commitaaf7e68c75a907c3c08e83dfd2972665a0f1c1a3 (patch)
treef15c080e765cd92e531dee7f868b6b79fec829cd /include/compat.h
parent39bfcc7f27b5c5173455140abf902b38c21f0acb (diff)
Fix printf format specifies for sqfs_u64
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/compat.h')
-rw-r--r--include/compat.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/compat.h b/include/compat.h
index 5f73158..b67d27f 100644
--- a/include/compat.h
+++ b/include/compat.h
@@ -31,6 +31,15 @@
# error I do not know how to trap integer overflows with this compiler
#endif
+#if defined(_WIN32) || defined(__WINDOWS__)
+# define PRI_U64 "%I64u"
+# define PRI_U32 "%I32u"
+#else
+# include <inttypes.h>
+# define PRI_U64 PRIu64
+# define PRI_U32 PRIu32
+#endif
+
#if SIZEOF_SIZE_T <= SIZEOF_INT
# define PRI_SZ "%u"
#elif SIZEOF_SIZE_T == SIZEOF_LONG