summaryrefslogtreecommitdiff
path: root/platform/darwin/src
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@gmail.com>2018-09-26 12:19:26 -0400
committerGitHub <noreply@github.com>2018-09-26 12:19:26 -0400
commita9959773128f57e05f278d4d67ea167b8b6f73f5 (patch)
tree145b749e37b3af6d9f94697124704f6b279960b9 /platform/darwin/src
parente6111a888e780789830daeae6634b90624fdb1e5 (diff)
downloadqtlocation-mapboxgl-a9959773128f57e05f278d4d67ea167b8b6f73f5.tar.gz
[ios] Fix for user location annotation jittering (and view annotations lagging) (#12895)
Diffstat (limited to 'platform/darwin/src')
-rw-r--r--platform/darwin/src/MGLFoundation.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLFoundation.h b/platform/darwin/src/MGLFoundation.h
index 3400c63979..be86bb92f9 100644
--- a/platform/darwin/src/MGLFoundation.h
+++ b/platform/darwin/src/MGLFoundation.h
@@ -3,3 +3,10 @@
#import <Foundation/Foundation.h>
#define MGL_EXPORT __attribute__((visibility ("default")))
+
+/* Using a compound statement (GNU Extension, supported by clang) */
+#define MGL_OBJC_DYNAMIC_CAST(object, type) \
+ ({ \
+ __typeof__( object ) temp##__LINE__ = (object); \
+ (type *)([temp##__LINE__ isKindOfClass:[type class]] ? temp##__LINE__ : nil); \
+ })