adding combined macOS iOS version guards

This commit is contained in:
Stefan Csomor 2020-07-13 10:51:12 +02:00 committed by Vadim Zeitlin
parent 7812657cbf
commit 6833b0e934
2 changed files with 12 additions and 1 deletions

View File

@ -18,6 +18,9 @@
#define WX_IS_MACOS_AVAILABLE(major, minor) \
__builtin_available(macOS major ## . ## minor, *)
#define WX_IS_MACOS_OR_IOS_AVAILABLE(macmajor, macminor, imajor, iminor) \
__builtin_available(macOS macmajor ## . ## macminor, iOS imajor ##. ## iminor, *)
#define WX_IS_MACOS_AVAILABLE_FULL(major, minor, micro) \
__builtin_available(macOS major ## . ## minor ## . ## micro, *)
@ -31,6 +34,14 @@
#define WX_IS_MACOS_AVAILABLE(major, minor) \
wxPlatformInfo::Get().CheckOSVersion(major, minor)
#ifdef wxOSX_USE_IPHONE
#define WX_IS_MACOS_OR_IOS_AVAILABLE(macmajor, macminor, imajor, iminor) \
wxPlatformInfo::Get().CheckOSVersion(imajor, iminor)
#else
#define WX_IS_MACOS_OR_IOS_AVAILABLE(macmajor, macminor, imajor, iminor) \
wxPlatformInfo::Get().CheckOSVersion(macmajor, macminor)
#endif
#define WX_IS_MACOS_AVAILABLE_FULL(major, minor, micro) \
wxPlatformInfo::Get().CheckOSVersion(major, minor, micro)

View File

@ -118,7 +118,7 @@ wxCGColorRefData::wxCGColorRefData(CGColorRef col)
}
else if (model != kCGColorSpaceModelRGB)
{
if ( WX_IS_MACOS_AVAILABLE(10, 11) )
if ( WX_IS_MACOS_OR_IOS_AVAILABLE(10, 11, 9, 0) )
{
rgbacol = CGColorCreateCopyByMatchingToColorSpace(wxMacGetGenericRGBColorSpace(), kCGRenderingIntentDefault, col, NULL);
noComp = CGColorGetNumberOfComponents(rgbacol);