aboutsummaryrefslogtreecommitdiff
path: root/src/common/torint.h
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <ffernandezmancera@gmail.com>2018-01-12 17:44:30 +0100
committerFernando Fernandez Mancera <ffernandezmancera@gmail.com>2018-01-12 17:44:30 +0100
commit06368e531097d3b973f1f052e77e7ffdecde1b70 (patch)
tree896316ffa657b1be13b5d358db6f3eb7059fad2b /src/common/torint.h
parentc8c258a4333815e195097a59801397dd7a169828 (diff)
downloadtor-06368e531097d3b973f1f052e77e7ffdecde1b70.tar.gz
tor-06368e531097d3b973f1f052e77e7ffdecde1b70.zip
Fix minGW compatibility issue with zu format specifier.
Define TOR_PRIuSZ as minGW compiler doesn't support zu format specifier for size_t type. Fixes #24861 on ac9eebd. Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
Diffstat (limited to 'src/common/torint.h')
-rw-r--r--src/common/torint.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index bc81c114f8..0b8061d24f 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -348,6 +348,16 @@ typedef uint32_t uintptr_t;
#endif /* (SIZEOF_SIZE_T == 4) || ... */
#endif /* !defined(SIZE_MAX) */
+#ifdef _WIN32
+# ifdef _WIN64
+# define TOR_PRIuSZ PRIu64
+# else
+# define TOR_PRIuSZ PRIu32
+# endif
+#else
+# define TOR_PRIuSZ "zu"
+#endif
+
#ifndef SSIZE_MAX
#if (SIZEOF_SIZE_T == 4)
#define SSIZE_MAX INT32_MAX