[futurebasic] Re: [FB] Intel vs. PPC?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2008 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Mon, 28 Jan 2008 17:53:09 +0100
John McKernon a crit :
> Just a quick question -
> 
> Does anyone know if there is any way to determine in code whether or not an
> FB app is running under Rosetta on an Intel processor?
> 
> Thanks!
> 

I don't know if I will provide you with a correct answer, but according 
to the FBtoC documentation, some notorious code is going to fail 
reliably under Mac Intel due to the byte order issue. Maybe that legacy 
syntax might be used to determine whether the app is running whether 
under Rosetta or natively.

Here is my wild attempt (not tested on Intel-based Mac since I don't 
have one at my disposal):


begin enum
_gestaltSysArchitecture = _"sysa"
_gestalt68k     = 1
_gestaltPowerPC = 2
_gestaltIntel   = 10
end enum

local mode
local fn GetNativeArchitecture
dim as OSErr err
dim as long @response : response = 0
err = fn Gestalt( _gestaltSysArchitecture, response )
end fn = response

local mode
local fn IsRunningOnRosetta
dim as short @ i : i = 1
end fn = (|@i| == 0 )


long if ( fn GetNativeArchitecture == _gestaltIntel )
long if ( fn IsRunningOnRosetta )
print "Rosetta"
xelse
print "Intel"
end if
end if


do
handleevents
until gFBQuit


Alain