Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tonyarnold/6e17ada0ecf859d5a036 to your computer and use it in GitHub Desktop.
Save tonyarnold/6e17ada0ecf859d5a036 to your computer and use it in GitHub Desktop.
#ifndef MagicalRecordXcode7CompatibilityMacros_h
#define MagicalRecordXcode7CompatibilityMacros_h
#if __has_feature(nullability)
#define MR_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#define MR_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
#define MR_nullable nullable
#define MR_nonnull nonnull
#define __MR_nullable __nullable
#define __MR_nonnull __nonnull
#else
#define MR_ASSUME_NONNULL_BEGIN
#define MR_ASSUME_NONNULL_END
#define MR_nullable
#define MR_nonnull
#define __MR_nullable
#define __MR_nonnull
#endif
#if __has_feature(objc_generics)
#define MR_GENERIC(class, ...) class<__VA_ARGS__>
#define MR_GENERIC_TYPE(type) type
#define __MR_kindof(class) __kindof class
#else
#define MR_GENERIC(class, ...) class
#define MR_GENERIC_TYPE(type) id
#define __MR_kindof(class) id
#endif
#endif /* MagicalRecordXcode7CompatibilityMacros_h */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment