GMSCompatabilityMacros.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // GMSCompatabilityMacros.h
  3. // Google Maps SDK for iOS
  4. //
  5. // Copyright 2015 Google Inc.
  6. //
  7. // Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
  8. // Service: https://developers.google.com/maps/terms
  9. //
  10. #import <Foundation/Foundation.h>
  11. #if !__has_feature(nullability) || !defined(NS_ASSUME_NONNULL_BEGIN) || \
  12. !defined(NS_ASSUME_NONNULL_END)
  13. #define GMS_ASSUME_NONNULL_BEGIN
  14. #define GMS_ASSUME_NONNULL_END
  15. #define GMS_NULLABLE
  16. #define GMS_NULLABLE_PTR
  17. #define GMS_NULLABLE_INSTANCETYPE instancetype
  18. #else
  19. #define GMS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
  20. #define GMS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
  21. #define GMS_NULLABLE nullable
  22. #define GMS_NULLABLE_PTR __nullable
  23. #define GMS_NULLABLE_INSTANCETYPE nullable instancetype
  24. #endif
  25. #if __has_feature(objc_generics) && defined(__IPHONE_9_0) && \
  26. __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0
  27. #define GMS_DECLARE_GENERICS 1
  28. #else
  29. #define GMS_DECLARE_GENERICS 0
  30. #endif
  31. #if GMS_DECLARE_GENERICS
  32. #define GMS_NSArrayOf(value) NSArray<value>
  33. #define GMS_NSDictionaryOf(key, value) NSDictionary<key, value>
  34. #define GMS_NSSetOf(value) NSSet<value>
  35. #else
  36. #define GMS_NSArrayOf(value) NSArray
  37. #define GMS_NSDictionaryOf(key, value) NSDictionary
  38. #define GMS_NSSetOf(value) NSSet
  39. #endif