Re: Detecting CPU type
Re: Detecting CPU type
- Subject: Re: Detecting CPU type
- From: Clark Cox <email@hidden>
- Date: Fri, 16 Sep 2005 09:07:25 -0400
2005/9/16, Peter <email@hidden>:
> Hello,
>
> I would like to find out CPU Type (PPC or x86), Gestalt seems to be
> discontinued and sysctl seems not too friendly (hw.cputype: 18 ???).
> Please let me know which is function or Cocoa class to be use.
Why wait until runtime to figure that out (i.e. the type of processor
that you're compiling for is known at compile time):
#ifdef __ppc__
PPC specific code goes here
#elif defined(__i386__)
x86 specific code goes here
#else
generic fallback code goes here
#endif
--
Clark S. Cox III
email@hidden
http://clarkcox3.livejournal.com/
http://homepage.mac.com/clarkcox3/
_______________________________________________
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