• 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
C typedef for NS ptrs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C typedef for NS ptrs?


  • Subject: C typedef for NS ptrs?
  • From: Andy O'Meara <email@hidden>
  • Date: Fri, 2 Apr 2010 16:38:48 -0500

Hey folks, quick question...

A have a couple vanilla NS object ptrs (e.g. NSWindow*) that I have to pass through some cross-plaform C++ code until it ends up in a .mm file where where the NS object is accessed.  The problem is that in the .cpp code, there's no obvious way to declare a NSWindow ptr so that thinks will link without complaint.  If, for example, in a key header I use:

#ifdef __OBJC__
    #define NSWindowPtr   NSWindow*
#else
    #define NSWindowPtr   void*
#endif

then everything of course compiles, but nothing links (since all the .cpp object files are looking for proc arguments with void* while the .mm object files are are declared with the real deal).

So, what can I replace that second macro with such that it meshes with ObjC's typedef mangling scheme?

Thanks in advance,
Andy
 _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: C typedef for NS ptrs?
      • From: "Sean McBride" <email@hidden>
    • Re: C typedef for NS ptrs?
      • From: Greg Parker <email@hidden>
  • Prev by Date: Re: MutableArray losing contents
  • Next by Date: Re: NSPredicate/NSExpression - can they solve this Core Data problem?
  • Previous by thread: Re: Implied use of Properties
  • Next by thread: Re: C typedef for NS ptrs?
  • Index(es):
    • Date
    • Thread