• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: programmatically determining if the machine is intel or not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: programmatically determining if the machine is intel or not


  • Subject: Re: programmatically determining if the machine is intel or not
  • From: Andrei Tchijov <email@hidden>
  • Date: Wed, 17 May 2006 08:41:35 -0400

This will test if executable was compiled on x86 and I believe Jonathan wants to determine architecture at run time.

You can determine CPU type using this command (from command line)

	sysctl hw.cputype

On my G5 it returns 18 and on my Mac Book Pro 7

I am sure if you will look for "sysctl", you should be able to fine programmatical equivalent.

On May 17, 2006, at 8:31 AM, Greg Hurrell wrote:

Doubtlessly there's an API for this, but here is one way of doing it without API (typed in Mail.app, untested):

#ifdef __i386__
BOOL isIntel = YES;
#else
BOOL isIntel = NO;
#endif

if (isIntel)
	NSLog(@"is Intel");
else
	NSLog(@"is not Intel");

Cheers,
Greg

El 17/05/2006, a las 13:53, Jonathan Sand escribió:

Does anyone know of a way to programmatically determine whether ones Mac code is running on PowerPC or Intel 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

_______________________________________________ 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
References: 
 >programmatically determining if the machine is intel or not (From: Jonathan Sand <email@hidden>)
 >Re: programmatically determining if the machine is intel or not (From: Greg Hurrell <email@hidden>)

  • Prev by Date: Re: programmatically determining if the machine is intel or not
  • Next by Date: Re: programmatically determining if the machine is intel or not
  • Previous by thread: Re: programmatically determining if the machine is intel or not
  • Next by thread: Re: programmatically determining if the machine is intel or not
  • Index(es):
    • Date
    • Thread