Determing if Your Stack is Running under Intel/Rosetta |
(OS X Only)
|
To determine whether your stack is running on an Intel CPU, use this function:
And it turns out thatfunction isIntel put shell("system_profiler SPHardwareDataType") into tData put matchText(tData,"(?s)CPU Type:\W*(.*?)\n",tType) into tIsMatch if tIsMatch then return (tType contains "Intel") else return "Error: Can't determine CPU type." end if end isIntel
the processor
will return "x86" if running truly native on Intel, or "Motorola PowerPC" it emulated.
So you can determine if your stack is running in Rosetta with this function:
Enjoy!function isRosetta return (isIntel() and (the processor contains "PowerPC")) end isRosetta
Posted 9/9/2006 by Ken Ray