Re: Determine architecture of a running application
Re: Determine architecture of a running application
- Subject: Re: Determine architecture of a running application
- From: Ken Thomases <email@hidden>
- Date: Fri, 22 Jul 2011 00:57:01 -0500
On Jul 21, 2011, at 11:34 PM, danchik wrote:
> Hello, how can one determine if the currently running app is 32bit or 64
>
> Specifically:
>
> I have a 32 bit plugin compiled for 10.5+ and it needs to know if it was loaded by 32bit or 64bit Safari
You can move this test to compile time. After all, only that variant of your universal binary that was compiled as 64-bit will be loaded by a 64-bit process, and ditto for 32-bit.
So, in your code do:
#ifdef __LP64__
// 64-bit code
#else
// 32-bit code
#endif
If you really want, you can embody this in a function like:
static inline BOOL is64Bit(void)
{
#ifdef __LP64__
return TRUE;
#else
return FALSE;
#endif
}
Cheers,
Ken
_______________________________________________
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