diff options
author | Magnus Hagander <magnus@hagander.net> | 2011-02-01 13:19:18 +0100 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2011-02-01 13:22:58 +0100 |
commit | ff18de81123a8412c1bcce94106d2ccca69aa193 (patch) | |
tree | 17eb747fa4edbeff3a292c530eebc5ad3c3e21a2 | |
parent | 2da967380facb5cd0476c2692fa72588980a8a20 (diff) | |
download | postgresql-ff18de81123a8412c1bcce94106d2ccca69aa193.tar.gz postgresql-ff18de81123a8412c1bcce94106d2ccca69aa193.zip |
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
-rw-r--r-- | src/include/port.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/port.h b/src/include/port.h index f139367064f..f2d751f33a9 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -165,6 +165,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 |