How can I check programatically if System is 32/64 bit (Mac)
-
spacebuddy
- Enthusiast

- Posts: 364
- Joined: Thu Jul 02, 2009 5:42 am
How can I check programatically if System is 32/64 bit (Mac)
Any help appreciated 
Re: How can I check programatically if System is 32/64 bit (
Maybe a silly question but why would you want to ?
OS X 32 bit can run 64 bit applications and OS X 64 bit can run 32 bit applications.
The only important thing is if the CPU is capable of 64 bit. From the intel based Mac's, only the first generation that wasn't sold for very long didn't have 64 bit support.
Most users will probably be able to run a 64 bit application but if you want to be sure, you can always compile a 32 bit application.
OS X 32 bit can run 64 bit applications and OS X 64 bit can run 32 bit applications.
The only important thing is if the CPU is capable of 64 bit. From the intel based Mac's, only the first generation that wasn't sold for very long didn't have 64 bit support.
Most users will probably be able to run a 64 bit application but if you want to be sure, you can always compile a 32 bit application.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
spacebuddy
- Enthusiast

- Posts: 364
- Joined: Thu Jul 02, 2009 5:42 am
Re: How can I check programatically if System is 32/64 bit (
wilbert wrote:Maybe a silly question but why would you want to ?
OS X 32 bit can run 64 bit applications and OS X 64 bit can run 32 bit applications.
The only important thing is if the CPU is capable of 64 bit. From the intel based Mac's, only the first generation that wasn't sold for very long didn't have 64 bit support.
Most users will probably be able to run a 64 bit application but if you want to be sure, you can always compile a 32 bit application.
I need this to put into my AboutBox that shows the user system information
I have this in my Windows version so I want to be consistent with the Mac version
and add this.
Just can't find any information on how to do it in Mac.
Re: How can I check programatically if System is 32/64 bit (
Code: Select all
GetBit = RunProgram("uname", "-m", "", #PB_Program_Open | #PB_Program_Read)
Bit$ = ""
While ProgramRunning(GetBit)
If AvailableProgramOutput(GetBit)
Bit$ = ReadProgramString(GetBit)
EndIf
Wend
CloseProgram(GetBit)
Debug Bit$www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
-
spacebuddy
- Enthusiast

- Posts: 364
- Joined: Thu Jul 02, 2009 5:42 am
Re: How can I check programatically if System is 32/64 bit (
Thanks for the info. But I am looking for an api, rather not use terminal.J. Baker wrote:Code: Select all
GetBit = RunProgram("uname", "-m", "", #PB_Program_Open | #PB_Program_Read) Bit$ = "" While ProgramRunning(GetBit) If AvailableProgramOutput(GetBit) Bit$ = ReadProgramString(GetBit) EndIf Wend CloseProgram(GetBit) Debug Bit$
I was using sysctl hw.cpu64bit_capable from the terminal, but removed it from the program.
Re: How can I check programatically if System is 32/64 bit (
sysctl can be used as an api, you don't need to use it from the terminal.spacebuddy wrote:I was using sysctl hw.cpu64bit_capable from the terminal, but removed it from the program.
But hw.cpu64bit_capable only tells you something about the cpu, not about what mode the OS is running.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)

