Skip to content

Instantly share code, notes, and snippets.

@justin
Created April 4, 2012 05:48
Show Gist options
  • Save justin/2298197 to your computer and use it in GitHub Desktop.
Save justin/2298197 to your computer and use it in GitHub Desktop.
More ARC Helper Macros
#ifndef SG_WEAK
#if defined __IPHONE_OS_VERSION_MIN_REQUIRED
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_4_3
#define __SG_WEAK __weak
#define SG_WEAK weak
#else
#define __SG_WEAK __unsafe_unretained
#define SG_WEAK unsafe_unretained
#endif
#elif defined __MAC_OS_X_VERSION_MIN_REQUIRED
#if __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_6
#define __SG_WEAK __weak
#define SG_WEAK weak
#else
#define __SG_WEAK __unsafe_unretained
#define SG_WEAK unsafe_unretained
#endif
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment