[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _WIN32 and __CYGWIN__

From: Ken Brown
Subject: Re: _WIN32 and __CYGWIN__
Date: Wed, 29 Aug 2018 12:21:49 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 8/29/2018 12:07 PM, Bruno Haible wrote:

Hi Bruno,

There's a lot of code in gnulib that contains 'defined _WIN32 && !
defined __CYGWIN__'.


The '! defined __CYGWIN__' part is redundant,
because _WIN32 is never defined on Cygwin.

No. _WIN32 is not defined _by_default_ on Cygwin. But users can use
"gcc -D_WIN32", when they want to access native Windows APIs (for
whatever reason).

Cygwin users who want to access native Windows APIs should simply #include <windows.h>, which does not cause _WIN32 to be defined.

gnulib doesn't control what kind of -D options are given when a package
that contains some gnulib source files is compiled. Yet, the expectation
is that it produces the same code with "gcc -D_WIN32" as with plain "gcc".

Why would anyone expect that?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]