Is there a way to determine if the Linux OS you’re running on is Linux 32 or 64-bit?
I don’t mean Xojo with #targetLinux or the CPU, but Linux itself. With MacOS I can assume it is 64-bit (the below commands work on Mac) and MBS have a routine for Windows to tell if the OS is 32 or 64 bit, bit I can’t find any solution within Xojo or without regarding Linux.
[quote=163384:@Ulrich Bogun]Don’t the #pragma isTarget32bit/64bit compiler commands work on Linux? You could set a variable using them.
(EDIT: In better words: #If Target32bit #Endif)[/quote]
No. Because we don’t compile for 64-bit on Linux yet, Target64Bit will always return False and Target32Bit will always return True, even if you’re on a 64-bit system.
Christian, that would tell me if it has a 32/64-bit CPU, but I might be running 32-bit Linux on a 64-bit CPU. Or is your function actually returning the Linux capability (and not the chip)? If I am running running 32-bit Linux on a 64-bit CPU I want it to return ‘32’.
But are these accurate or is there a better way?[/quote]
The first is accurate and the best way because it will differentiate between running 32bit Linux on a 64bit processor (reporting i386, i586, or i686) and actually running 64bit Linux (x86_64).
The second won’t be since Xojo doesn’t compile for 64bit yet and that will always be false.