Is "WIN32" #defined in Cygwin builds?

Started by Tom Laneover 10 years ago3 messages
#1Tom Lane
tgl@sss.pgh.pa.us

I started wondering about $subject because we are fairly schizophrenic
about whether we believe this. For example, only a few lines apart in
dirmod.c, there are

#if defined(WIN32) || defined(__CYGWIN__)

#if defined(WIN32) && !defined(__CYGWIN__)

Presumably, one of these could be simplified, but I'm not sure which.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#1)
Re: Is "WIN32" #defined in Cygwin builds?

On 08/31/2015 02:21 PM, Tom Lane wrote:

I started wondering about $subject because we are fairly schizophrenic
about whether we believe this. For example, only a few lines apart in
dirmod.c, there are

#if defined(WIN32) || defined(__CYGWIN__)

#if defined(WIN32) && !defined(__CYGWIN__)

Presumably, one of these could be simplified, but I'm not sure which.

No, and we've made sure not to do that ourselves, or at least I hope we
have. Here's what the cygwin compiler says:

andrew@antonio ~/bf
$ touch xx.c

andrew@antonio ~/bf
$ gcc -E -dM xx.c | grep WIN
#define __WINT_MAX__ 4294967295U
#define __WINT_MIN__ 0U
#define __SIZEOF_WINT_T__ 4
#define __CYGWIN__ 1
#define __WINT_TYPE__ unsigned int
#define __CYGWIN32__ 1

andrew@antonio ~/bf

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#2)
Re: Is "WIN32" #defined in Cygwin builds?

Andrew Dunstan <andrew@dunslane.net> writes:

On 08/31/2015 02:21 PM, Tom Lane wrote:

I started wondering about $subject because we are fairly schizophrenic
about whether we believe this.

No, and we've made sure not to do that ourselves, or at least I hope we
have.

OK, thanks. I was wondering whether I'd broken the Cygwin build with
a65e0864, but it should be okay.

Not sure if it's worth trying to clean up the #if tests that are redundant
given this knowledge. It looks like there's about a dozen.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers