what guarantee is there that pligin would be loaded of the same architecture and not proxied through the PluginHost?

There might be another issue now, I think safari 5.1 (even when ran in 32bit) now loads the plugins in another process through com.apple.WebKit.PluginProcess instead of loading them in the same process as Safari as it used to before the 5.1 :( In which case nothing wont help since the plugin in question expects to operate in the same process as the Safari.




----- Original Message ----- From: "Ken Thomases" <k...@codeweavers.com>
To: "danchik" <danc...@rebelbase.com>
Cc: <Cocoa-dev@lists.apple.com>
Sent: Thursday, July 21, 2011 10:57 PM
Subject: Re: Determine architecture of a running application


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