Reputation: 876
I have an include file which I need to include if building against the 10.7 SDK or higher, but should not be included otherwise (i.e. for 10.6 sdk). What preprocessor flag can I use in this case?
Upvotes: 4
Views: 1859
Reputation: 966
#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 work with older xcode too
Upvotes: 3
Reputation: 1007
Have a look at the Availability.h
header, the __MAC_10_7
preprocessor token 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
Upvotes: 8