Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002405graphvizBuild/Installpublic2013-12-18 02:212013-12-31 14:58
Assigned Toerg 
Platformi386OSMac OS XOS Version10.5.8
Summary0002405: 'kCTForegroundColorFromContextAttributeName' undeclared
DescriptionBuilding 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.
TagsNo tags attached.
Attached Filesbz2 file icon main.log.bz2 [^] (26,906 bytes) 2013-12-18 02:21
diff file icon gvplugin_quartz.h.diff [^] (511 bytes) 2013-12-19 04:52 [Show Content]

- Relationships

-  Notes
User avatar (0000652)
erg (administrator)
2013-12-18 09:40

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

#include <CoreText/CoreText.h>

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.
User avatar (0000653)
erg (administrator)
2013-12-18 09:45

Okay, so it's not going to be that simple, as apparently the -I flags are not correct for finding CoreText.h.
User avatar (0000655)
ryandesign (reporter)
2013-12-19 04:51

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.
User avatar (0000660)
erg (administrator)
2013-12-31 14:58

Should be fixed by patch from Glen Low.

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker