Re: How to find out if my app is running on PPC or i386
Re: How to find out if my app is running on PPC or i386
- Subject: Re: How to find out if my app is running on PPC or i386
- From: Stefan Werner <email@hidden>
- Date: Tue, 13 Feb 2007 20:24:17 +0100
On Feb 13, 2007, at 7:57 PM, George Warner wrote:
What I'm asking: is there a function in Carbon to find
out on which architecture my application is running
(I386/PPC) so that i can take the proper measurements?
The optimum solution is to build the appropriate code for the
appropriate
architecture. For example:
#if defined(__ppc__)
// Do PowerPC only code here
#elif defined(__i386__)
// Do Intel only code here
#endif
Make sure that you use the __ppc__ and __i386__ macros only when you
have code that actually depends on the CPU and not endianness. For
any endian related conditions, I highly recommend testing
TARGET_RT_LITTLE_ENDIAN or TARGET_RT_BIG_ENDIAN instead or using Core
Endian if it's just a byteswapping thing. This will save you lots of
trouble two years from know when Apple announces the switch to
UltraSAPRC CPUs. ;)
Stefan
_______________________________________________
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