summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-01-16 10:32:05 +0100
committerEike Ziller <eike.ziller@qt.io>2020-01-16 09:41:42 +0000
commit92a39e8d86862fba847791954c6d54b91d4d779e (patch)
tree2ed681cd9ea4ba89a82fd230b306b4c1ace030cd
parent5f8fe92105444ca3d49d263d4960ce9957fdbbc4 (diff)
downloadqt-creator-92a39e8d86862fba847791954c6d54b91d4d779e.tar.gz
iOS: Fix retrieving USB serial number with macOS 10.15 SDK
When building without explicit compatibility with oder macOS versions (-mmacosx-version-min), the Apple headers use a different value for the constant that is used to retrieve the USB serial number, and that just doesn't work for some reason. Make sure we use a value for the constant that works in all cases. Fixes: QTCREATORBUG-23460 Change-Id: Ie7de52a49a41c2ad33b2a6d2410414a9f1f05b1e Reviewed-by: Cristian Adam <cristian.adam@qt.io>
-rw-r--r--src/plugins/ios/iosdevice.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp
index e341c62516..1dae70200b 100644
--- a/src/plugins/ios/iosdevice.cpp
+++ b/src/plugins/ios/iosdevice.cpp
@@ -42,6 +42,16 @@
#include <IOKit/IOKitLib.h>
#include <IOKit/usb/IOUSBLib.h>
#include <CoreFoundation/CoreFoundation.h>
+
+// Work around issue with not being able to retrieve USB serial number.
+// See QTCREATORBUG-23460.
+// For an unclear reason USBSpec.h in macOS SDK 10.15 uses a different value if
+// MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_14, which just does not work.
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_14
+#undef kUSBSerialNumberString
+#define kUSBSerialNumberString "USB Serial Number"
+#endif
+
#endif
#include <exception>