diff options
author | lhchavez <lhchavez@lhchavez.com> | 2019-01-06 08:29:56 -0800 |
---|---|---|
committer | lhchavez <lhchavez@lhchavez.com> | 2019-01-06 08:29:56 -0800 |
commit | b5e8272fdcab4e7f238a72d0b9c9fc9c753fd381 (patch) | |
tree | 413dcc28a6d67e6301028e2b77ca316c620efff7 /src/cc-compat.h | |
parent | 7b453e7e39c6e27d63be0922a153e1cb47f33218 (diff) | |
download | libgit2-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.h | 14 |
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" |