git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c43d079)
Force use of "%I64d" format for 64 bit ints on MinGW.
2011年4月27日 14:09:23 +0000 (10:09 -0400)
2011年4月27日 14:09:23 +0000 (10:09 -0400)
Both this and "%lld" work, but the compiler's format checking doesn't
like "%lld", so we get all sorts of spurious warnings.


diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 34f40041298e4378d9d9d9a0ec2f5bceaf2a497c..8863bb300cd5b78abe1fbcc51ee646ce760cfd3f 100644 (file)
--- 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
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /