diff options
Diffstat (limited to 'platform/darwin/src/MGLFoundation_Private.h')
-rw-r--r-- | platform/darwin/src/MGLFoundation_Private.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLFoundation_Private.h b/platform/darwin/src/MGLFoundation_Private.h index 71737c2cf9..db81bde3de 100644 --- a/platform/darwin/src/MGLFoundation_Private.h +++ b/platform/darwin/src/MGLFoundation_Private.h @@ -11,3 +11,9 @@ void MGLInitializeRunLoop(); (type *)([temp##__LINE__ isKindOfClass:[type class]] ? temp##__LINE__ : nil); \ }) +#define MGL_OBJC_DYNAMIC_CAST_AS_PROTOCOL(object, proto) \ + ({ \ + __typeof__( object ) temp##__LINE__ = (object); \ + (id< proto >)([temp##__LINE__ conformsToProtocol:@protocol( proto )] ? temp##__LINE__ : nil); \ + }) + |