setlocale and gettext in Postgres - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject setlocale and gettext in Postgres
Date
Msg-id 4D416D11.6080805@tpf.co.jp
Whole thread Raw
Responses Re: setlocale and gettext in Postgres  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
List pgsql-hackers
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






Attachment

pgsql-hackers by date:

Previous
From: Itagaki Takahiro
Date:
Subject: Re: Extensions support for pg_dump, patch v27
Next
From: Fujii Masao
Date:
Subject: Re: Allowing multiple concurrent base backups