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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to