C ++ Mac preprocessor flag for basic sdk

I have an include file that I need to include if it was created against the 10.7 SDK or higher, but should not be included otherwise (i.e. for 10.6 sdk). What preprocessor flag can be used in this case?

+4
source share
2 answers

Look at the Availability.h header, the __MAC_10_7 token of the preprocessor should do what you want.

 #include <Availability.h> #ifdef __MAC_10_7 // Code that requires the Mac OS X 10.7 SDK or later #endif 
+7
source

https://developer.apple.com/library/mac/#documentation/developertools/conceptual/cross_development/Using/using.html

 #if __MAC_OS_X_VERSION_MAX_ALLOWED > 1050 // note use of 1050 instead of __MAC_10_5 # include <security/pam_appl.h> #else # include <pam/pam_appl.h> #endif 

This should also work with old xcode.

+2
source

All Articles