Re: [PATCHES] snprintf() argument reordering not working under - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] snprintf() argument reordering not working under
Date
Msg-id 4938.1133669123@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] snprintf() argument reordering not working under  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> (See the quoted text under the posted text as well.)  Basically,
> libintl.h on Win32 replaces *printf calls with its own versions, and
> does it using macros, _just_ like we do.  This of course causes
> conflicts and the system fails to compile.  The _fix_ was to disable
> port/*printf on Win32 when using NLS because NLS wants to use its own
> *printf.  I _assumed_ that libintl.h did this so it could use its own
> routines that understood %$, but never verified that.

Oops ... [ insert standard cliche about assumptions ]

It might be interesting to find out why libintl is replacing these
functions if not to support arg reordering, but I suppose the bottom
line will just be that Microsoft is as brain dead as usual :-(

> Anyway, I think the big question is, was the pginstaller built with a
> libintl that replaces *printf, and is it an *printf that doesn't
> understand positional parameters, and so, how can we fix it.

Would it work to modify c.h so that it #include's libintl.h, then #undefs
these macros, then #includes port.h to define 'em the way we want?
Some or all of this might need to be #ifdef WIN32, but that seems like
a reasonably noninvasive solution if it can work.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reducing relation locking overhead
Next
From: Bruce Momjian
Date:
Subject: Re: I can't get row type from tuple (SPI)