Re: determine if a CPU is Intel 64-bit
Re: determine if a CPU is Intel 64-bit
- Subject: Re: determine if a CPU is Intel 64-bit
- From: Ronald Oussoren <email@hidden>
- Date: Tue, 26 Mar 2013 17:21:17 +0100
On 26 Mar, 2013, at 17:14, Scott Ribe <email@hidden> wrote:
> On Mar 26, 2013, at 9:52 AM, Ronald Oussoren wrote:
>
>> Have you looked at hw.cpu64bit_capable?
>
> I'll have the user check it, but do you know if it's reliable?
There's also hw.optional.x86_64 that's at least somewhat documented in the sys/sysctl.h header file.
Both correctly indicated that a 10.5 system with a 32-bit kernel is capable of running 64-bit binaries, which hw.machine is i386 on that machine.
The alternative is to ship a small 32-bit/64-bit universal binary and use that to check if it is capable of running 64-bit software, something like:
/* cc -o runs64bit -arch i386 -arch x86_64 runs64bit.c */
#include <stdio.h>
int main(void)
{
#ifdef __LP64__
printf("YES\n");
return 0;
#else
printf("NO\n");
return 1;
#endif
}
/* EOF */
Ronald
>
> --
> Scott Ribe
> email@hidden
> http://www.elevated-dev.com/
> (303) 722-0567 voice
>
>
>
>
_______________________________________________
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