From a02e40990433e59dee14129c119184dcbca4c2e3 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 1 Sep 2011 09:13:37 +0300 Subject: [PATCH] Move the line to undefine setlocale() macro on Win32 outside USE_REPL_SNPRINTF ifdef block. It has nothing to do with whether the replacement snprintf function is used. It caused no live bug, because the replacement snprintf function is always used on Win32, but it was nevertheless misplaced. --- src/include/port.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/include/port.h b/src/include/port.h index 2794002ca9..0cd3a3834d 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -176,15 +176,6 @@ 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 @@ -227,6 +218,16 @@ __attribute__((format(printf, 1, 2))); #endif #endif /* USE_REPL_SNPRINTF */ +/* + * 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 + /* Portable prompt handling */ extern char *simple_prompt(const char *prompt, int maxlen, bool echo); -- 2.40.0