Re: Determining architecture type at run time
Re: Determining architecture type at run time
- Subject: Re: Determining architecture type at run time
- From: Terry Lambert <email@hidden>
- Date: Mon, 27 Apr 2009 09:08:26 -0700
Don't write out architecture type, just write out a byte order indicator. Specifically, put an asymmetric magic number in your archive header.
Alternately, just make everything Intel byte order all the time so the archive isn't host dependent.
-- Terry On Apr 27, 2009, at 4:36 AM, rohan a < email@hidden> wrote: I need this to support cross architecture restore for my backup/restore utility.
On 4/27/09, Terry Lambert <email@hidden> wrote:
On Apr 27, 2009, at 2:11 AM, rohan a <email@hidden> wrote:
Hello, I need to determine at program run time, the architecture type(x86, ppc or x86_64) of the Mac OS X machine. Is it possible to do this? Does Mac OS provide any API for this?
Why do you need to know?
You can always:
#if __PPC__ #if __LP64__ ...
and set some variable at compile time, but the only real reason to need to know is if your code is architecture dependent, which you'd determine at compile time anyway (and it's better to write your code so it doesn't care).
-- Terry
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden