public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Why is __unix__ defined, and not __WINDOWS__ ?
@ 2019-05-12 18:22 Agner Fog
  2019-05-12 19:52 ` Houder
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Agner Fog @ 2019-05-12 18:22 UTC (permalink / raw)
  To: cygwin

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?

A C/C++ program will check for these macros if it wants to know which 
operating system you are compiling for, and this will give the wrong result.




--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-05-13 16:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-12 18:22 Why is __unix__ defined, and not __WINDOWS__ ? Agner Fog
2019-05-12 19:52 ` Houder
2019-05-12 19:54 ` Hans-Bernhard Bröker
2019-05-12 20:29   ` Lee
2019-05-13  4:12   ` Agner Fog
2019-05-13  5:40     ` Brian Inglis
2019-05-13 14:49       ` Agner Fog
2019-05-13 16:16         ` Yaakov Selkowitz
2019-05-13  7:56     ` Soegtrop, Michael
2019-05-12 20:33 ` Mike Gran via cygwin
2019-05-12 20:54   ` Houder
2019-05-13  4:40     ` Brian Inglis
2019-05-13 10:04       ` Houder
2019-05-12 22:00 ` Houder
2019-05-12 23:12   ` Houder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).