From 2f9effeb64e00325c6d0978c48f2c820021bb414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 11 Nov 2015 15:26:03 +0100 Subject: Fix OS X 10.11 (Xcode 7.1) build issues due to strongly typed enums MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apple changed some enums in the 10.11 SDK from being just: enum { ... }; typedef uint64_t Foo; to: typedef CF_ENUM(uint64_t, Foo) { ... }; which in C++11 mode expands to: typedef enum Foo : uint64_t Foo; enum Foo : uint64_t { ... }; The use of strongly typed enums means we need to explicitly cast from int in the places where we know what we are doing. Change-Id: I7c8cfdbc0549471a3292de14d8b766fe17133e25 Reviewed-by: Simon Hausmann Reviewed-by: Tor Arne Vestbø --- .../other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm') diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm index 3056904dcf..65dbff4f92 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -199,7 +199,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) CFRange cfRange; NSRange range = NSMakeRange(0, 0); - if (!AXValueGetValue((AXValueRef)value, kAXValueCFRangeType, &cfRange)) + if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCFRangeType), &cfRange)) qDebug() << "Could not get CFRange value out of AXValueRef"; else if (cfRange.location < 0 || cfRange.length < 0) qDebug() << "Cannot convert CFRange with negative location or length to NSRange"; @@ -217,7 +217,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) + (NSRect)_rectFromValue:(CFTypeRef)value { NSRect rect = NSMakeRect(0, 0, 0, 0); - if (!AXValueGetValue((AXValueRef)value, kAXValueCGRectType, reinterpret_cast(&rect))) + if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGRectType), reinterpret_cast(&rect))) { qDebug() << "Could not get CGRect value out of AXValueRef"; } @@ -227,7 +227,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) + (NSPoint)_pointFromValue:(CFTypeRef)value { NSPoint point = NSMakePoint(0, 0); - if (!AXValueGetValue((AXValueRef)value, kAXValueCGPointType, reinterpret_cast(&point))) + if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGPointType), reinterpret_cast(&point))) { qDebug() << "Could not get CGPoint value out of AXValueRef"; } @@ -237,7 +237,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) + (NSSize)_sizeFromValue:(CFTypeRef)value { NSSize size = NSMakeSize(0, 0); - if (!AXValueGetValue((AXValueRef)value, kAXValueCGSizeType, reinterpret_cast(&size))) + if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGSizeType), reinterpret_cast(&size))) { qDebug() << "Could not get CGSize value out of AXValueRef"; } @@ -308,7 +308,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) - (CFTypeRef)_attributeValue:(CFStringRef)attribute forRange:(NSRange)aRange { CFRange cfRange = CFRangeMake(aRange.location, aRange.length); - AXValueRef range = AXValueCreate(kAXValueCFRangeType, &cfRange); + AXValueRef range = AXValueCreate(AXValueType(kAXValueCFRangeType), &cfRange); CFTypeRef value = [self _attributeValue:attribute forParameter:range]; CFRelease(range); return value; @@ -324,7 +324,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) - (CFTypeRef)_attributeValue:(CFStringRef)attribute forPoint:(CGPoint)aPoint { - AXValueRef point = AXValueCreate(kAXValueCGPointType, &aPoint); + AXValueRef point = AXValueCreate(AXValueType(kAXValueCGPointType), &aPoint); CFTypeRef value = [self _attributeValue:attribute forParameter:point]; CFRelease(point); return value; -- cgit v1.2.3