Why would #ifdef Q_OS_DARWIN not work on a Mac?
-
Hi all.
If I enclose code with this on a Mac, it's marked as disabled and indeed is not compiled.
Anyone know why?
Thanks!
-
-
Thanks for your reply. I had read that doc, but it simply says the symbol IS defined.
The preprocessor, despite being on a Mac, says it ISN'T defined. It also says Q_OS_MACOS isn't defined.
UPDATE: I discovered what triggers the failure: If #ifdef is the first significant line in the file, it doesn't work. If you have something else above it (like a #include), it works. I've never encountered this before. Is it normal?
-
Yes it's normal,
Q_OS_DARWIN
is not defined by the compiler, you can find it the QtGlobals header. As long as you don't include anything Qt, you won't have access to any of these platform defines. -
Good to know. Thanks.
-
You're welcome !
If you have all the answers you need, please mark the thread as solved using the "Topic Tools" button so that other forum users may know it's good :)