From b6d3a64faec2fb0004b834fb503962a04338cfb2 Mon Sep 17 00:00:00 2001 From: Vaclav Slavik Date: Sun, 19 Apr 2015 13:15:09 +0200 Subject: [PATCH] Don't check for always-available CGColorCreateGenericRGB This function is available on OS X since 10.5, which is the minimum supported version of wx 3.0. Fixes Xcode 6.3 warning triggered by checking availability of a symbol that wasn't marked as weak_import. --- src/osx/core/colour.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/osx/core/colour.cpp b/src/osx/core/colour.cpp index e39d215cdc..7de9084fdc 100644 --- a/src/osx/core/colour.cpp +++ b/src/osx/core/colour.cpp @@ -70,14 +70,11 @@ void wxColour::InitRGBA (ChannelType r, ChannelType g, ChannelType b, ChannelTyp CGColorRef col = 0 ; #if wxOSX_USE_COCOA_OR_CARBON - if ( CGColorCreateGenericRGB != NULL ) - col = CGColorCreateGenericRGB( (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) ); - else + col = CGColorCreateGenericRGB( (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) ); +#else + CGFloat components[4] = { (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) } ; + col = CGColorCreate( wxMacGetGenericRGBColorSpace() , components ) ; #endif - { - CGFloat components[4] = { (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) } ; - col = CGColorCreate( wxMacGetGenericRGBColorSpace() , components ) ; - } wxASSERT_MSG(col != NULL, "Invalid CoreGraphics Color"); m_cgColour.reset( col ); }