[os x] use of deprecated functions CMGetProfileByAVID and CMCloseProfile
Brought to you by:
maxderhak
sampleicc fails to build on 10.11 with this error from deprecated system functions:
g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"SampleICC\" -DVERSION=\"1.6.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRERROR=1 -DHAVE_TIFFLIB=1 -DPLATFORM_DARWIN_PPC=1 -I. -I../../.. -I../../../IccProfLib -I../../../Contrib/ICC_utils -I/sw/include -g -O2 -MT extract_probe_data.o -MD -MP -MF .deps/extract_probe_data.Tpo -c -o extract_probe_data.o extract_probe_data.cpp extract_probe_data.cpp:103:5: warning: 'CMProfileRef' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations] CMProfileRef displayProfile = NULL; ^ /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h:1001:41: note: 'CMProfileRef' has been explicitly marked deprecated here typedef struct OpaqueCMProfileRef* CMProfileRef DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER; ^ extract_probe_data.cpp:112:5: warning: 'CMError' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations] CMError err = CMGetProfileByAVID((CMDisplayIDType)displayID, ^ /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h:998:41: note: 'CMError' has been explicitly marked deprecated here typedef OSStatus CMError DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER; ^ extract_probe_data.cpp:112:19: error: use of undeclared identifier 'CMGetProfileByAVID' CMError err = CMGetProfileByAVID((CMDisplayIDType)displayID, ^ extract_probe_data.cpp:112:39: warning: 'CMDisplayIDType' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations] CMError err = CMGetProfileByAVID((CMDisplayIDType)displayID, ^ /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h:1017:41: note: 'CMDisplayIDType' has been explicitly marked deprecated here typedef UInt32 CMDisplayIDType DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER; ^ extract_probe_data.cpp:122:5: error: use of undeclared identifier 'CMCloseProfile' CMCloseProfile(displayProfile); ^ 3 warnings and 2 errors generated.
Would love to see this fixed
Workaround: == modify ./Contrib/Mac_OS_X/extract_probe_data/extract_probe_data.cpp,
change the fuction getTheDisplayColorSpace() to just return NULL;
CGColorSpaceRef getTheDisplayColorSpace() {
return NULL;
}
Using the approach of https://gitlab.com/pteam/pteam-qtbase/commit/b06304e164ba47351fa292662c1e6383c081b5ca (from qtpaintengine) got me a clean build of extract_probe_data.cpp on 10.13
Last edit: Daniel Macks 2018-05-10