• 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: Detecting platform architecture within Cocoa app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting platform architecture within Cocoa app?


  • Subject: Re: Detecting platform architecture within Cocoa app?
  • From: Torsten Curdt <email@hidden>
  • Date: Wed, 30 Jul 2008 03:53:07 +0200

Have a look here:

http://vafer.org/gitweb/FeedbackReporter.git?a=blob;f=Sources/Main/SystemDiscovery.m;h=417d8a1f0b71224b5bb2271028926d4c5874c497;hb=63855ef8957a393a2aebd091b421f8b310395d04

Endian-ness testing is also here:

http://vafer.org/gitweb/uif2iso4mac.git?a=blob;f=Sources/MyDocument.m;h=82a2ddc8614b8d5fd6536fd2b418ab1d3beeb550;hb=6d0582e95d20375d943d8ec4103dc841bfc9083b

HTH

cheers
--
Torsten

On Jul 30, 2008, at 03:44, Steve Christensen wrote:

On Jul 29, 2008, at 12:56 PM, Jack Skellington wrote:

Is there a way to determine if an App is running on Intel or PPC
from within the App?

Depending on what you're trying to do, you can go at least a couple routes at build time.


If you only care about endianness:

#ifdef __BIG_ENDIAN__
#ifdef __LITTLE_ENDIAN__


If you care about the actual architecture:

#ifdef __ppc__ 		// 32-bit PPC
#ifdef __ppc64__	// 64-bit PPC
#ifdef __i386__		// 32-bit Intel
#ifdef __x86_64__	// 64-bit Intel


There are also parallel ones defined in /usr/include/ TargetConditionals.h:


#if TARGET_RT_LITTLE_ENDIAN
#if TARGET_RT_BIG_ENDIAN

#if TARGET_CPU_PPC
#if TARGET_CPU_PPC64
#if TARGET_CPU_X86
#if TARGET_CPU_X86_64

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Detecting platform architecture within Cocoa app? (From: Jack Skellington <email@hidden>)
 >Re: Detecting platform architecture within Cocoa app? (From: Steve Christensen <email@hidden>)

  • Prev by Date: Re: Repositioning a content view w/in a window
  • Next by Date: Re: method naming
  • Previous by thread: Re: Detecting platform architecture within Cocoa app?
  • Next by thread: Re: Detecting platform architecture within Cocoa app?
  • Index(es):
    • Date
    • Thread