summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2017-10-02 13:27:13 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-10-04 12:08:32 +0000
commit18af3226765b62312acc8f801cc531fde0d9822b (patch)
treea50f7e5135b10d4f61f7ee55a472d173854081ad
parented5a1134d50f6dbed3fc568c799a39f4e2338056 (diff)
CoreBluetooth - fix compilation errors for 10.13 SDKv5.10.0-beta2v5.10.0-beta1
Apple broke source code compatibility by moving 'identifier' properties from CBPeripheral and CBCentral classes into the new CBPeer class and marking it as "since 10.13". As a result we have compilation errors in the code that was valid since 10.7. To workaround this issue, we introduce a category with 'identifier' property declarations for SDK >= 10.13 and target < 10.13. Change-Id: Id7c9d33a9c8ae7627a06b4c1930e70cede1e5b07 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/bluetooth/osx/osxbtutility_p.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bluetooth/osx/osxbtutility_p.h b/src/bluetooth/osx/osxbtutility_p.h
index 148ebc0b..5d90a54e 100644
--- a/src/bluetooth/osx/osxbtutility_p.h
+++ b/src/bluetooth/osx/osxbtutility_p.h
@@ -313,4 +313,23 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT_OSX)
QT_END_NAMESPACE
+#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(101300) && QT_MACOS_DEPLOYMENT_TARGET_BELOW(101300)
+
+ // In the macOS 10.13 SDK, the identifier property was moved from the CBPeripheral
+ // and CBCentral classes to a new CBPeer base class. Because CBPeer is only available
+ // on macOS 10.13 and above, the same is true for -[CBPeer identifier]. However,
+ // since we know that the derived classes have always had this property,
+ // we'll explicitly mark its availability here. This will not adversely affect
+ // using the identifier through the CBPeer base class, which will still require macOS 10.13.
+
+@interface CBPeripheral (UnguardedWorkaround)
+@property (readonly, nonatomic) NSUUID *identifier NS_AVAILABLE(10_7, 5_0);
+@end
+
+@interface CBCentral (UnguardedWorkaround)
+@property (readonly, nonatomic) NSUUID *identifier NS_AVAILABLE(10_7, 5_0);
+@end
+
+#endif
+
#endif