(svn r27675) -Fix [FS#6502]: [OSX] Building with 10.11 or 10.12 SDKs.

This commit is contained in:
michi_cc
2016-10-31 19:29:01 +00:00
parent 51052f4961
commit 94b3965989
3 changed files with 32 additions and 11 deletions

View File

@@ -110,15 +110,23 @@ static CGColorSpaceRef QZ_GetCorrectColorSpace()
static CGColorSpaceRef colorSpace = NULL;
if (colorSpace == NULL) {
CMProfileRef sysProfile;
if (CMGetSystemProfile(&sysProfile) == noErr) {
colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile);
CMCloseProfile(sysProfile);
} else {
colorSpace = CGColorSpaceCreateDeviceRGB();
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (MacOSVersionIsAtLeast(10, 5, 0)) {
colorSpace = CGDisplayCopyColorSpace(CGMainDisplayID());
} else
#endif
{
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(HAVE_OSX_1011_SDK)
CMProfileRef sysProfile;
if (CMGetSystemProfile(&sysProfile) == noErr) {
colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile);
CMCloseProfile(sysProfile);
}
#endif
}
if (colorSpace == NULL) colorSpace = CGColorSpaceCreateDeviceRGB();
if (colorSpace == NULL) error("Could not get system colour space. You might need to recalibrate your monitor.");
}