|Anonymous | Login||2017-11-20 08:35 EST|
|Main | My View | View Issues | Change Log | Roadmap | My Account|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002405||graphviz||Build/Install||public||2013-12-18 02:21||2013-12-31 14:58|
|Platform||i386||OS||Mac OS X||OS Version||10.5.8|
|Summary||0002405: 'kCTForegroundColorFromContextAttributeName' undeclared|
|Description||Building graphviz 2.35.20131218.0545 fails on Mac OS X 10.5.8 Leopard i386:|
gvtextlayout_quartz.c: In function 'quartz_new_layout':
gvtextlayout_quartz.c:39: error: 'kCTForegroundColorFromContextAttributeName' undeclared (first use in this function)
gvtextlayout_quartz.c:39: error: (Each undeclared identifier is reported only once
gvtextlayout_quartz.c:39: error: for each function it appears in.)
There was no problem building graphviz 2.35.20131202.0545 on the same system.
The error surprises me because kCTForegroundColorFromContextAttributeName is documented as existing in Leopard and later.
Perhaps the required header CTStringAttributes.h is not being included? But then I don't understand why it builds on later OS X versions.
|Tags||No tags attached.|
|Attached Files|| main.log.bz2 [^] (26,906 bytes) 2013-12-18 02:21|
gvplugin_quartz.h.diff [^] (511 bytes) 2013-12-19 04:52 [Show Content]
My take on this is that you want to include CoreText.h which includes CTStringAttributes.h. It appears that CoreText.h is brought in by ApplicationServices.h if __MAC_OS_X_VERSION_MIN_REQUIRED is defined. (See gvplugin_quartz.h.) So either Leopard does not define __MAC_OS_X_VERSION_MIN_REQUIRED or one of the inclusions is missing in Leopard .h files.
I note that the code was amended to explicitly include CoreText.h for an appropriately new version of iOS. Given we have a similar test for the quartz_new_layout function, but that test also checks for a minimum osx version, I'd suggest using the same double test for including CoreText.h. That is, use
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 || __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 30200
I no longer have access to a leopard machine. If this looks like a safe solution, please try it and let me know if it works. If so, I will commit the change. Thanks.
|Okay, so it's not going to be that simple, as apparently the -I flags are not correct for finding CoreText.h.|
I've spent some hours looking into this tonight. From what I can tell:
- In gvplugin_quartz.h you include Availability.h, which defines __MAC_OS_X_VERSION_MIN_REQUIRED or __IPHONE_OS_VERSION_MIN_REQUIRED.
- If __IPHONE_OS_VERSION_MIN_REQUIRED is defined you include CoreGraphics.h and if __MAC_OS_X_VERSION_MIN_REQUIRED is defined you include ApplicationServices.h.
- CoreText was introduced in Mac OS X version 10.4 as a private framework and made public in 10.5, and introduced in iOS in version 3.2. ApplicationServices.h includes CoreText.h. Since on iOS you aren't including ApplicationServices.h, in gvtextlayout_quartz.c you explicitly include CoreText.h on iOS 3.2 and later.
- CoreText.h includes CTStringAttributes.h.
- On Mac OS X 10.6 and later, CTStringAttributes.h defines kCTForegroundColorFromContextAttributeName.
- Although several system frameworks on Mac OS X 10.5 and even 10.4 reference kCTForegroundColorFromContextAttributeName, and although the Apple documentation claims it is supported on 10.5 and later, it is not defined in CTStringAttributes.h or anywhere else that I can find. I think it was inadvertently omitted from CTStringAttributes.h on 10.5, along with a few other symbols.
- I'm able to get past this problem by defining kCTForegroundColorFromContextAttributeName to the correct value, if it's undefined; see attached patch.
I then run into a new build failure for which I filed 0002406.
|Should be fixed by patch from Glen Low.|
|2013-12-18 02:21||ryandesign||New Issue|
|2013-12-18 02:21||ryandesign||File Added: main.log.bz2|
|2013-12-18 09:40||erg||Note Added: 0000652|
|2013-12-18 09:45||erg||Note Added: 0000653|
|2013-12-19 04:51||ryandesign||Note Added: 0000655|
|2013-12-19 04:52||ryandesign||File Added: gvplugin_quartz.h.diff|
|2013-12-31 14:58||erg||Note Added: 0000660|
|2013-12-31 14:58||erg||Assigned To||=> erg|
|2013-12-31 14:58||erg||Status||new => resolved|
|2013-12-31 14:58||erg||Resolution||open => fixed|
|MantisBT 1.2.5[^] Copyright © 2000 - 2011 MantisBT Group|