I noticed that in MacOS X (Lion), the macro __unix__ is not defined.
Since MacOS has its roots in BSD UNIX, shouldn’t that be the case?
Is it possible to let the compiler/preprocessor know that I want it to be considered a UNIX system?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The predefined macros site suggests using:
To distinguish UNIX systems. They also have warning notes about a number of compilers that don’t set any of these. Depending on why you care about what the platform is you might be better off looking at configure time (in
configure.acor whatever build system you’re using).