On 16 Nov 2014, at 03:06, Jens Alfke <[email protected]> wrote:
>> On Nov 15, 2014, at 5:24 PM, David Hoerl <[email protected]> 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 protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to