Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: NISHIYAMA Tomoaki <tomoakin(at)staff(dot)kanazawa-u(dot)ac(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64
Date: 2011-12-01 16:29:26
Message-ID: 4ED7AB66.5030203@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/27/2011 09:18 AM, NISHIYAMA Tomoaki wrote:
> Hi,
>
>>>>> +/* __MINGW64_VERSION_MAJOR is related to both 32/64 bit gcc compiles by
>>>>> + * mingw-w64, however it gots defined only after
>>>>> Why not use __MINGW32__, which is defined without including any headers?
>>> Because it's defined by other than mingw-w64 compilers.
>> I see. That's because mingw (not -w64).
>> Should it be ok if mingw is ok with that condition?
>
> This really breaks mingw gcc 4.6.1 :( it does not have crtdefs.h)
> If moving downward do not break MSVC, perhaps its the good way.
> Otherwise, we might check for the presence of crtdefs.h with configure?
>

I have looked at this a bit. It's fairly ugly, and the only moderately
clean way I see forward is a configure test to check for a mingw-w64
compiler, e.g. by running gcc -E -dM over a file which just includes
stdio.h and checking for the definedness of __MINGW64__VERSION_MAJOR, or
something similar.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2011-12-01 16:32:10 Re: Command Triggers
Previous Message Jeff Janes 2011-12-01 14:58:14 Re: synchronous commit vs. hint bits