diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2011-04-27 10:09:23 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2011-04-27 10:09:23 -0400 |
commit | 52d01c2f52c462d29ae0fdfa44c3cae129148a6d (patch) | |
tree | 181364b0daa08783f4a75917787d96bd1bd56c5a | |
parent | c43d0791ac5fb765a088d41564cd44747aef42d8 (diff) | |
download | postgresql-52d01c2f52c462d29ae0fdfa44c3cae129148a6d.tar.gz postgresql-52d01c2f52c462d29ae0fdfa44c3cae129148a6d.zip |
Force use of "%I64d" format for 64 bit ints on MinGW.
Both this and "%lld" work, but the compiler's format checking doesn't
like "%lld", so we get all sorts of spurious warnings.
-rw-r--r-- | src/include/port/win32.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h index 34f40041298..8863bb300cd 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -88,6 +88,19 @@ #define PGDLLEXPORT #endif +/* + * MinGW compilers accept both "%I64d" and "%lld" for 64 bit ints, + * but whine about the latter, so force the former, regardless of what + * configure found. + */ +#if __GNUC__ +#ifdef INT64_FORMAT +#undef INT64_FORMAT +#undef UINT64_FORMAT +#endif +#define INT64_FORMAT "%I64d" +#define UINT64_FORMAT "%I64u" +#endif /* * IPC defines |