diff --git a/src/bluetooth/osx/osxbtutility_p.h b/src/bluetooth/osx/osxbtutility_p.h index 148ebc0ba285b3d589c6d601a074b7e3484b9f2b..5d90a54ed162480d9affc10c7fffb230db7df8bc 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