summaryrefslogtreecommitdiff
path: root/src/cc-compat.h
diff options
context:
space:
mode:
authorlhchavez <lhchavez@lhchavez.com>2019-01-06 08:29:56 -0800
committerlhchavez <lhchavez@lhchavez.com>2019-01-06 08:29:56 -0800
commitb5e8272fdcab4e7f238a72d0b9c9fc9c753fd381 (patch)
tree413dcc28a6d67e6301028e2b77ca316c620efff7 /src/cc-compat.h
parent7b453e7e39c6e27d63be0922a153e1cb47f33218 (diff)
downloadlibgit2-b5e8272fdcab4e7f238a72d0b9c9fc9c753fd381.tar.gz
Attempt at fixing the MingW64 compilation
It seems like MingW64's size_t is defined differently than in Linux.
Diffstat (limited to 'src/cc-compat.h')
-rw-r--r--src/cc-compat.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/cc-compat.h b/src/cc-compat.h
index 0f05cd2d9..5d3e652b1 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -47,9 +47,17 @@
/* Define the printf format specifer to use for size_t output */
#if defined(_MSC_VER) || defined(__MINGW32__)
-# define PRIuZ "Iu"
-# define PRIxZ "Ix"
-# define PRIdZ "Id"
+
+# if (SIZE_MAX == ULLONG_MAX)
+# define PRIuZ "I64u"
+# define PRIxZ "I64x"
+# define PRIdZ "I64d"
+# else
+# define PRIuZ "Iu"
+# define PRIxZ "Ix"
+# define PRIdZ "Id"
+# endif
+
#else
# define PRIuZ "zu"
# define PRIxZ "zx"