summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2011-02-01 13:19:18 +0100
committerMagnus Hagander <magnus@hagander.net>2011-02-01 13:22:22 +0100
commit1c4c264aa5c58777a18df5a268cc7702cdf5c940 (patch)
treea946b3d7e677506ec64b7c83059a9b786c0e45cf /src
parentd6c1dc176a422ed19d698bb8ff9ed7b38c04a320 (diff)
Undefine setlocale() macro on Win32
New versions of libintl redefine setlocale() to a macro which causes problems when the backend and libintl are linked against different versions of the runtime, which is often the case in msvc builds. Hiroshi Inoue, slightly updated comment by me
Diffstat (limited to 'src')
-rw-r--r--src/include/port.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/port.h b/src/include/port.h
index 584a89eb702..65b80ef5134 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -176,6 +176,15 @@ extern unsigned char pg_tolower(unsigned char ch);
#ifdef printf
#undef printf
#endif
+/*
+ * Versions of libintl >= 0.18? try to replace setlocale() with a macro
+ * to their own versions. Remove the macro, if it exists, because it
+ * ends up calling the wrong version when the backend and libintl use
+ * different versions of msvcrt.
+ */
+#if defined(setlocale) && defined(WIN32)
+#undef setlocale
+#endif
extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
extern int