While reading various C and C++ sources, I have encountered two macros __APPLE__
and __OSX__
. I found plenty of use of __OSX__
in vari
See http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system#OSXiOSandDarwin
#ifdef __APPLE__
#include
#if TARGET_OS_MAC
...
#endif /* TARGET_OS_MAC */
#endif /* __APPLE__ */
Note that __OSX__
does NOT exist, at least as of Xcode 9.
Also note that it is #if TARGET_OS_MAC
not #ifdef
. It is always defined, but is 0 when not macOS.