Re: Detecting CPU type
Re: Detecting CPU type
- Subject: Re: Detecting CPU type
- From: Damien Bobillot <email@hidden>
- Date: Fri, 16 Sep 2005 13:38:19 +0200
Le 16 sept. 05 à 10:41, Peter a écrit :
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.
The CPU type is known at compilation time : gcc compiles to PPC or
x86. So, it's possible to hardcode CPU Architecture detection :
bool isPPC() {
#ifdef __ppc__
return true;
#else
return false;
#end
}
bool isx86() {
#ifdef __i386__
return true;
#else
return false;
#end
}
You'll find sample codes to get some hardware informations using the
mach API at :
http://www.cocoadev.com/index.pl?HowToGetHardwareAndNetworkInfo
--
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