Hi all,

I see now the following lines in libintl.h of version
0.18.1.1 which didn't exist in 0.17 version.

/* Support for the locale chosen by the user.  */
#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined
__WIN32__ || defined __CYGWIN__

#undef setlocale
#define setlocale libintl_setlocale
extern char *setlocale (int, const char *);
.
.

The macro may cause a trouble especially on Windows.

Though libintl_setlocale() calls setlocale() internally,
what the Mingw version of libintl library calls is the one
in msvcrt.dll not in the libraries which main programs link.
Unfortunately locale-aware functions like printf() calls
in main programs would see "C" locales not the locales set
by libintl_setlocale().

Attached is a patch to disable the macro on Windows.

regards,
Hiroshi Inoue





*** port.h.orig 2011-01-15 05:29:13.436000000 +0900
--- port.h      2011-01-23 21:56:19.554000000 +0900
***************
*** 176,181 ****
--- 176,188 ----
  #ifdef printf
  #undef printf
  #endif
+ /*
+  * Versions of libintl >= 0.18? try to replace setlocale() with a macro
+  * to their own versions.  Disable the macro, if it exists.
+  */
+ #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
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to