• 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: Mixing Cocoa and Carbon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing Cocoa and Carbon


  • Subject: Re: Mixing Cocoa and Carbon
  • From: Damien Bobillot <email@hidden>
  • Date: Tue, 14 Mar 2006 16:31:37 +0100

Rick Langschultz wrote :

I was wondering if my application can run in cocoa on Mac OS X 10.4.-- and in Carbon on macs that don't support universal binaries. I have an application written in Carbon from a few years ago. I added some stuff to it, as well as ported it to Cocoa.

Both PPC and Intel Macs can run cocoa, carbon and mixed applications. You just have to compile them as a universal binary.


The only difference between Intel and PPC macs is that ppc macs have a ppc proc and that intel macs have an intel proc : the APIs are exactly the sames. There's obviously also some artifacts, like the big/little endian issue, but in most case you don't have to worry about the used cpu.

Would I have to create a wrapper program that decides what version to run. Some of the code used in the cocoa version is specific to intel only hardware (i.e. some ASM code)

You may use code like : #ifdef __ppc__ do_that_on_ppc(); #elif __i386__ do_this_on_intel(); #end

It will use do_that_on_ppc in the ppc version of the universal binary , and do_this_on_intel in the intel version.

--
Damien Bobillot

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Mixing Cocoa and Carbon (From: Rick Langschultz <email@hidden>)

  • Prev by Date: Re: Drag and drop in NSOutlineView connected to a NSTreeController
  • Next by Date: Re: Drag and drop in NSOutlineView connected to a NSTreeController
  • Previous by thread: Mixing Cocoa and Carbon
  • Next by thread: Re: Mixing Cocoa and Carbon
  • Index(es):
    • Date
    • Thread