Re: Possible for a running iOS app to determine if its in 32 bit or 64 bit
Re: Possible for a running iOS app to determine if its in 32 bit or 64 bit
- Subject: Re: Possible for a running iOS app to determine if its in 32 bit or 64 bit
- From: Uli Kusterer <email@hidden>
- Date: Sun, 16 Nov 2014 06:58:43 +0100
On 16 Nov 2014, at 03:06, Jens Alfke <email@hidden> wrote:
>> On Nov 15, 2014, at 5:24 PM, David Hoerl <email@hidden> wrote:
>>
>> I'm looking for any API I can use to settle this once and for all. As always, any pointers most appreciated.
>
> BOOL in64bit = (sizeof(void*) == 8);
What’s wrong with good old
#if __LP64__
printf(“Running 64 bit\n");
#else
printf(“Running 32 bit\n");
#endif
? Only the right message gets compiled in, as a constant expression. Since the OS picks 64 or 32 bit executable portions of the binary anyway, might as well make intent and the way it works obvious.
The only other thing would be to use sysctl() if you want to know what CPU you’re running on (but that only makes sense for e.g. system info to send back home, because 32-bit executable portion running (using Finder’s “Launch as 32 bit” Info checkbox) would then report 64 bit.
Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden