• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Working-around a Symbol Conflict
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Working-around a Symbol Conflict


  • Subject: Re: Working-around a Symbol Conflict
  • From: "William H. Schultz" <email@hidden>
  • Date: Wed, 1 Oct 2008 11:02:32 -0700


On Sep 26, 2008, at 2:07 PM, Ken Thomases wrote:

On Sep 26, 2008, at 12:12 PM, Jonathan 'Wolf' Rentzsch wrote:

I'm integrating an open-source code base (discount
http://www.pell.portland.or.us/~orc/Code/markdown/) into my Cocoa app and
have run into a snag.



discount declares a `Line` type which conflicts with the QuickDraw type of
the same name (even though I'm targeting 10.5 only and not explicitly using
QuickDraw).



Here's the error:


In file included from /Users/wolf/code/trac/cocoa/MarkdownLive/MyDocument.m:3:

/Users/wolf/code/trac/cocoa/MarkdownLive/discount-1.2.10/markdown.h: 25:
error: 'Line' redeclared as different kind of symbol


/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ ApplicationServices.framework/Frameworks/QD.framework/Headers/ QuickdrawAPI.h:782:
error: previous declaration of 'Line' was here



Anyone have any suggestions to work-around this type conflict? I'd really
rather not modify the discount source directly. I probably could do a
project-wide `#define Line discountLine`, but I bet there's a less- hacky
solution.

I've seen the opposite done.

#define Line QDLine
#import <ApplicationServices/ApplicationServices.h>
#undef Line


If you can figure out what's including the QuickDraw headers and why, you might be able to short-circuit that. For example, #define the guard macro that prevents double-inclusion of the QuickDraw header(s). This only works if the QuickDraw headers were being included incidentally rather than really being needed by the framework's other headers.


Cheers,
Ken


I've also used the guard macro method to avoid OpenTransport headers. This is quite useful, since OT defines stuff that's in the Unix networking headers. If I remember correctly, they're enums in OT but macros in BSD. That was even worse.


-------------------------------
Hank Schultz
Cedrus Corporation
http://www.cedrus.com/


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: iPhone development with distcc
  • Next by Date: Variable length arrays in debugger
  • Previous by thread: Re: Xcode 3.1.1 breaks my app [solved]
  • Next by thread: Variable length arrays in debugger
  • Index(es):
    • Date
    • Thread