Re: Build failure on thrips

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>, chris(at)chrullrich(dot)net
Subject: Re: Build failure on thrips
Date: 2017-08-26 16:18:02
Message-ID: 23489.1503764282@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> thrips is showing some weird syntax errors that I suspect mean it's
> misinterpreting "_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);"
> as a declaration.

Actually, looking closer, isn't the problem that you've stuck a
function call into the midst of declarations? Some compilers
will allow that, but it's not valid C90. You probably just need
to move the call down past "EXEC SQL END DECLARE SECTION".

> So what it looks like to me is that either that function isn't
> available on all Windows versions, or there's some other header
> you need to include to get it on some versions.

Microsoft's own documentation contradicts that:
https://msdn.microsoft.com/en-us/library/26c0tb7x(v=vs.80).aspx

So I'm not sure why the undefined-function results on frogmouth
and jacana, although I notice they are using gcc not MSVC.
Unless someone has a better idea, I'd suggest working around
that like so:

#ifdef WIN32
#ifdef _MSC_VER /* requires MSVC */
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
#endif
#endif

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2017-08-26 16:40:05 Re: Variable substitution in psql backtick expansion
Previous Message Tom Lane 2017-08-26 15:42:50 Re: Build failure on thrips