• 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: bringing windows c++ code to Macintosh
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bringing windows c++ code to Macintosh


  • Subject: Re: bringing windows c++ code to Macintosh
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 10 Sep 2008 09:24:54 -0500

On Sep 10, 2008, at 6:52 AM, M Pulis wrote:

What is the difference between ".m" and ".mm" files? A .m file can not access C++ code?

A .m file is Objective-C, and .mm is Objective-C++. So, correct, a .m file can't include C++ code (even indirectly in the headers it #includes).



You need to examine what those HGLOBAL fields are being used for (their semantics, not their syntax), research what the appropriate alternative would be to achieve similar semantics in the Mac API(s) that you've chosen, and then rework the code in terms of those new Mac APIs. It is never going to be as simple as just declaring the same fields with different type. You may not need those fields, you may need different fields, you may need more fields or fewer -- it requires redesign.

Of course, yes, that was the case in my other porting projects. In the case of the fields I am looking at they appear to be simple pointers to pointers to globally allocated blocks of memory, much like having an opaque handle as a field in a record.

If you're just looking for a data type which is a handle (pointer to pointer), then you might use Handle. At this point, Handle is archaic. It dates back to classic Mac OS (pre-Mac OS X) and isn't used much by modern Mac APIs.


You might also just use a void** or YourCustomType**.

Regards,
Ken

_______________________________________________
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


  • Follow-Ups:
    • Re: bringing windows c++ code to Macintosh
      • From: M Pulis <email@hidden>
References: 
 >bringing windows c++ code to Macintosh (From: M Pulis <email@hidden>)
 >Re: bringing windows c++ code to Macintosh (From: Ken Thomases <email@hidden>)
 >Re: bringing windows c++ code to Macintosh (From: M Pulis <email@hidden>)

  • Prev by Date: Re: breakpoints ignored while running unit tests! Why?
  • Next by Date: Re: Xcode 3.1, g++-4.2 and Debug building
  • Previous by thread: Re: bringing windows c++ code to Macintosh
  • Next by thread: Re: bringing windows c++ code to Macintosh
  • Index(es):
    • Date
    • Thread