• 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: Which Mac models use the new 64-bit Objective-C ABI?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which Mac models use the new 64-bit Objective-C ABI?


  • Subject: Re: Which Mac models use the new 64-bit Objective-C ABI?
  • From: "Påhl Melin" <email@hidden>
  • Date: Thu, 20 Nov 2008 20:07:31 +0100

On Thu, Nov 20, 2008 at 8:55 AM, Shawn Erickson <email@hidden> wrote:
>On Thu, Nov 20, 2008 at 8:39 AM, Påhl Melin <email@hidden> wrote:
>> On Thu, Nov 20, 2008 at 7:43 AM, Shawn Erickson <email@hidden> wrote:
>>> The decision between 64b and 32b is made at compile time for your
>>> compiled code. As a result your 64b executable wont run under the 32b
>>> runtime not matter what you do.
>>>
>>> ...however you can of course (normally you would do this) create a
>>> universal application that contains x86-64, x86, etc. in it and at
>>> launch time the OS can decide which to run based on the systems
>>> capabilities.
>>
>> But if I create a universal project with both x86-64 and i386 code and
>> run the application on a 32-bit system, is it possible to detect in
>> the code that I'm running the 32-bit ABI?
>
> Again this is decided at compile time. So your 32b compiled version
> can be coded to do what it needs to do while your 64b version can
> avoid doing this because of the exception mechanism unification.
>
> Review the documents I linked... They outline how to use standard
> preprocessor defines to adjust your code based on it being compiled
> for 32b, 64b, little endian, big endian, etc.

Ah, of course! Thanks for the reminder – I forgot about the old preprocessor...

I generally try to avoid the preprocessor and was looking for some
nice Cocoa method like

if ([NSBundle yesIamRunningTheNewFancy64bitABI]) { /* ... */ }

... but of course you can do the same with an #ifdef.

>> Also, on a 64-bit capable system, will the x86-64 version always be
>> choosen when launching?
>
> No not always. IIRC Leopard defaults to running the 64b executable if
> it exists but users, etc. can override that.

/ Påhl
_______________________________________________

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

  • Prev by Date: Re: Which Mac models use the new 64-bit Objective-C ABI?
  • Next by Date: Re: Info request on developing codec
  • Previous by thread: Re: Which Mac models use the new 64-bit Objective-C ABI?
  • Next by thread: Plist -> array -> tableview
  • Index(es):
    • Date
    • Thread