From 4e8121aaf1037f2e927ba80d4da85ebe3eef5060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 4 Nov 2016 09:49:46 -0700 Subject: [PATCH] [ios, macos] Fixed Xcode 7.x compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Define NSErrorDomain before its first use. Define NSNotificationName as a typedef instead of a #define. Guard these shims on the existence of NS_STRING_ENUM rather than another macro that’s new to Xcode 8. Fixes #6906. --- platform/darwin/src/MGLTypes.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/darwin/src/MGLTypes.h b/platform/darwin/src/MGLTypes.h index e9e05bc68..a6b7254b5 100644 --- a/platform/darwin/src/MGLTypes.h +++ b/platform/darwin/src/MGLTypes.h @@ -20,6 +20,13 @@ NS_ASSUME_NONNULL_BEGIN +#ifndef NS_STRING_ENUM + #define NS_STRING_ENUM + #define NS_EXTENSIBLE_STRING_ENUM + typedef NSString *NSErrorDomain; + typedef NSString *NSNotificationName; +#endif + /** Indicates an error occurred in the Mapbox SDK. */ extern NSErrorDomain const MGLErrorDomain; @@ -97,9 +104,3 @@ NS_ASSUME_NONNULL_END #define NS_MUTABLE_DICTIONARY_OF(ObjectClass...) NSMutableDictionary #endif #endif - -#if !defined(FOUNDATION_SWIFT_SDK_EPOCH_LESS_THAN) || FOUNDATION_SWIFT_SDK_EPOCH_LESS_THAN(8) - #define NS_STRING_ENUM - #define NS_EXTENSIBLE_STRING_ENUM - #define NSNotificationName NSString * -#endif