Why is __unix__ defined, and not __WINDOWS__ ?
Lee
ler762@gmail.com
Sun May 12 20:29:00 GMT 2019
On 5/12/19, Hans-Bernhard Bröker wrote:
> Am 12.05.2019 um 20:22 schrieb Agner Fog:
>
>> I have noticed that the gcc and clang compilers have defined the
>> preprocessing macro __unix__, but not __WINDOWS__, _WIN32, or _WIN64
>> when compiling a windows executable.
>>
>> Why is this?
>
> Because it's correct that way. Cygwin runs on Windows, but it _is_ not
> Windows.
Or you can use a cross-compiler to create a 'native' windows
executable that doesn't require any of the cygwin dlls.
$ echo | gcc -dM -E -xc - | grep '#define _WIN32 '
$ echo | i686-w64-mingw32-gcc -dM -E -xc - | grep '#define _WIN32 '
#define _WIN32 1
Lee
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list