Permalink
Browse files

Updated preprocessor macros for 10.8+ and new ObjC features.

  • Loading branch information...
1 parent 4c200d2 commit 0049e9a9d22e7cfb6530cbde1408af1e161067e6 @logancollins committed Jul 24, 2012
Showing with 10 additions and 3 deletions.
  1. +8 −1 Mocha/MochaDefines.h
  2. +2 −2 Mocha/Objects/MOObjCRuntime.h
@@ -8,5 +8,12 @@
#define MOCHA_EXTERN extern __attribute__((visibility("default")))
-#define MOCHA_STATIC_INLINE static inline __attribute__((visibility("default")))
+#define MOCHA_INLINE static inline __attribute__((visibility("default")))
+#if (__has_feature(objc_fixed_enum))
+#define MOCHA_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
+#define MOCHA_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
+#else
+#define MOCHA_ENUM(_type, _name) _type _name; enum
+#define MOCHA_OPTIONS(_type, _name) _type _name; enum
+#endif
@@ -7,6 +7,7 @@
//
#import <Foundation/Foundation.h>
+#import <Mocha/MochaDefines.h>
/*!
@@ -17,12 +18,11 @@
* @constant MOObjCOwnershipRuleRetain Retained
* @constant MOObjCOwnershipRuleCopy Copied/retained
*/
-enum {
+typedef MOCHA_ENUM(NSUInteger, MOObjCOwnershipRule) {
MOObjCOwnershipRuleAssign = 0,
MOObjCOwnershipRuleRetain,
MOObjCOwnershipRuleCopy,
};
-typedef NSUInteger MOObjCOwnershipRule;
/*!

0 comments on commit 0049e9a

Please sign in to comment.