Created
July 21, 2010 09:35
-
-
Save tadelv/484269 to your computer and use it in GitHub Desktop.
Macro for conditional code compilation depending on OS versions in iOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// iOS4Check.h | |
// | |
// Thank you: | |
// http://cocoawithlove.com/2010/07/tips-tricks-for-conditional-ios3-ios32.html | |
// | |
// Created by Vid Tadel on 7/9/10. | |
// | |
#import <UIKit/UIKit.h> | |
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_2_0 | |
#define kCFCoreFoundationVersionNumber_iPhoneOS_2_0 478.23 | |
#endif | |
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_2_1 | |
#define kCFCoreFoundationVersionNumber_iPhoneOS_2_1 478.26 | |
#endif | |
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_2_2 | |
#define kCFCoreFoundationVersionNumber_iPhoneOS_2_2 478.29 | |
#endif | |
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_3_0 | |
#define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47 | |
#endif | |
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_3_1 | |
#define kCFCoreFoundationVersionNumber_iPhoneOS_3_1 478.52 | |
#endif | |
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_3_2 | |
#define kCFCoreFoundationVersionNumber_iPhoneOS_3_2 478.61 | |
#endif | |
#ifndef kCFCoreFoundationVersionNumber_iPhoneOS_4_0 | |
#define kCFCoreFoundationVersionNumber_iPhoneOS_4_0 550.32 | |
#endif | |
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 | |
#define IF_IOS4_OR_GREATER(...) \ | |
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iPhoneOS_4_0) \ | |
{ \ | |
__VA_ARGS__ \ | |
} | |
#else | |
#define IF_IOS4_OR_GREATER(...) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment