From 57dfeea75bc5300d5ac75bbd4c29e754aadf8a00 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sun, 2 Oct 2016 21:19:39 +0200 Subject: [PATCH 1/1] Fixed build with MaxOSX10.12 SDK This patch adds missing includes that allows to build the module with the 10.12 SDK and Xcode 8. Change-Id: Ieab48f6a0582b916ceecbbb9a01a4169d6ba53f5 --- src/bluetooth/osx/osxbtcentralmanager_p.h | 8 ++++++++ src/bluetooth/osx/osxbtledeviceinquiry.mm | 5 +++++ src/bluetooth/osx/osxbtutility.mm | 3 +++ 3 files changed, 16 insertions(+) diff --git a/src/bluetooth/osx/osxbtcentralmanager_p.h b/src/bluetooth/osx/osxbtcentralmanager_p.h index e64e5ba..81c5e8d 100644 --- a/src/bluetooth/osx/osxbtcentralmanager_p.h +++ b/src/bluetooth/osx/osxbtcentralmanager_p.h @@ -67,6 +67,14 @@ #include "corebluetoothwrapper_p.h" +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12, __IPHONE_NA) +#include +#include +#include +#include +#include +#endif + @class QT_MANGLE_NAMESPACE(OSXBTCentralManager); QT_BEGIN_NAMESPACE diff --git a/src/bluetooth/osx/osxbtledeviceinquiry.mm b/src/bluetooth/osx/osxbtledeviceinquiry.mm index 88370fa..143a12b 100644 --- a/src/bluetooth/osx/osxbtledeviceinquiry.mm +++ b/src/bluetooth/osx/osxbtledeviceinquiry.mm @@ -48,6 +48,11 @@ #include "corebluetoothwrapper_p.h" +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12, __IPHONE_NA) +#import +#import +#endif + QT_BEGIN_NAMESPACE namespace OSXBluetooth { -- 2.7.4 diff -ruN qtconnectivity-opensource-src-5.7.1-orig/src/bluetooth/osx/osxbtcentralmanager.mm qtconnectivity-opensource-src-5.7.1/src/bluetooth/osx/osxbtcentralmanager.mm --- qtconnectivity-opensource-src-5.7.1-orig/src/bluetooth/osx/osxbtcentralmanager.mm 2016-11-02 03:10:05.000000000 -0500 +++ qtconnectivity-opensource-src-5.7.1/src/bluetooth/osx/osxbtcentralmanager.mm 2017-10-23 22:38:03.000000000 -0500 @@ -1077,13 +1077,13 @@ { using namespace OSXBluetooth; -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) const CBManagerState state = central.state; #else const CBCentralManagerState state = central.state; #endif -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStateUnknown || state == CBManagerStateResetting) { #else @@ -1099,7 +1099,7 @@ } // Let's check some states we do not like first: -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) { #else if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) { @@ -1119,7 +1119,7 @@ return; } -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStatePoweredOff) { #else if (state == CBCentralManagerStatePoweredOff) { @@ -1138,7 +1138,7 @@ return; } -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStatePoweredOn) { #else if (state == CBCentralManagerStatePoweredOn) { diff -ruN qtconnectivity-opensource-src-5.7.1-orig/src/bluetooth/osx/osxbtledeviceinquiry.mm qtconnectivity-opensource-src-5.7.1/src/bluetooth/osx/osxbtledeviceinquiry.mm --- qtconnectivity-opensource-src-5.7.1-orig/src/bluetooth/osx/osxbtledeviceinquiry.mm 2016-11-02 03:10:05.000000000 -0500 +++ qtconnectivity-opensource-src-5.7.1/src/bluetooth/osx/osxbtledeviceinquiry.mm 2017-10-23 22:39:52.000000000 -0500 @@ -204,7 +204,7 @@ dispatch_queue_t leQueue(qt_LE_queue()); Q_ASSERT(leQueue); -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) const CBManagerState cbState(central.state); if (cbState == CBManagerStatePoweredOn) { #else @@ -225,7 +225,7 @@ }); [manager scanForPeripheralsWithServices:nil options:nil]; } // Else we ignore. -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) } else if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) { #else } else if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) { @@ -239,7 +239,7 @@ } [manager setDelegate:nil]; -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) } else if (cbState == CBManagerStatePoweredOff) { #else } else if (cbState == CBCentralManagerStatePoweredOff) {