From 92a39e8d86862fba847791954c6d54b91d4d779e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 16 Jan 2020 10:32:05 +0100 Subject: [PATCH] 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 --- src/plugins/ios/iosdevice.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index e341c625160..1dae70200bc 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -42,6 +42,16 @@ #include #include #include + +// 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