setlocale and gettext in Postgres

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: setlocale and gettext in Postgres
Date: 2011-01-27 13:03:13
Message-ID: 4D416D11.6080805@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
port.h.diff text/plain 506 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2011-01-27 13:15:44 Re: Allowing multiple concurrent base backups
Previous Message Heikki Linnakangas 2011-01-27 12:38:32 COPYRIGHT vs psql \copyright