From: Agner Fog <agner@agner.org>
To: cygwin@cygwin.com
Subject: Why is __unix__ defined, and not __WINDOWS__ ?
Date: Sun, 12 May 2019 18:22:00 -0000 [thread overview]
Message-ID: <5fbb6229-da17-c056-19b9-9819c684a8ad@agner.org> (raw)
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
next reply other threads:[~2019-05-12 18:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-12 18:22 Agner Fog [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5fbb6229-da17-c056-19b9-9819c684a8ad@agner.org \
--to=agner@agner.org \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).