Re: programmatically determining if the machine is intel or not
Re: programmatically determining if the machine is intel or not
- Subject: Re: programmatically determining if the machine is intel or not
- From: Jonathan Sand <email@hidden>
- Date: Wed, 17 May 2006 05:58:07 -0700
On May 17, 2006, at 5:45 AM, Bob Kuehne wrote:
On May 17, 2006, at 7:53 AM, Jonathan Sand wrote:
Does anyone know of a way to programmatically determine whether
ones Mac code is running on PowerPC or Intel hardware?
uname should do it:
struct utsname un;
uname( &un );
printf( "%s\n", un.machine );
--
%man 3 uname
Thanks everyone. This seems to work just fine (for now -- until Apple
changes their mind):
#include <sys/utsname.h>
- (BOOL)isIntel {
struct utsname name;
uname(&name);
NSString *hardware = [NSString stringWithCString:name.machine
encoding:NSASCIIStringEncoding];
return ![@"Power Macintosh" isEqualToString:hardware];
}
Jonathan Sand
(: enlightenment would be nice :)
email@hidden
_______________________________________________
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