Re: Mixing Cocoa and Carbon
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