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__'.

Yes.

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?

Ken

Reply via email to