Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 116b67f

Browse files
committed
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.
1 parent f759ef1 commit 116b67f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/include/port.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,6 @@ extern unsigned char pg_ascii_tolower(unsigned char ch);
183183
#ifdef printf
184184
#undef printf
185185
#endif
186-
/*
187-
* Versions of libintl >= 0.18? try to replace setlocale() with a macro
188-
* to their own versions. Remove the macro, if it exists, because it
189-
* ends up calling the wrong version when the backend and libintl use
190-
* different versions of msvcrt.
191-
*/
192-
#if defined(setlocale) && defined(WIN32)
193-
#undef setlocale
194-
#endif
195186

196187
extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
197188
extern int
@@ -234,6 +225,16 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
234225
#endif
235226
#endif /* USE_REPL_SNPRINTF */
236227

228+
/*
229+
* Versions of libintl >= 0.18? try to replace setlocale() with a macro
230+
* to their own versions. Remove the macro, if it exists, because it
231+
* ends up calling the wrong version when the backend and libintl use
232+
* different versions of msvcrt.
233+
*/
234+
#if defined(setlocale) && defined(WIN32)
235+
#undef setlocale
236+
#endif
237+
237238
/* Portable prompt handling */
238239
extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
239240

0 commit comments

Comments
 (0)