How to determine cross-platform OS architecture?

Just starting out? Need help? Post your questions and find answers here.
damn
New User
New User
Posts: 9
Joined: Wed Mar 07, 2018 11:12 am

How to determine cross-platform OS architecture?

Post by damn »

I know how to do it on Windows OS, but not on Linux and MacOS.
User avatar
mk-soft
Always Here
Always Here
Posts: 6208
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: How to determine cross-platform OS architecture?

Post by mk-soft »

Purebasic uses the respective OS libraries to create programs.
It must be compiled on the respective operating system.

If you use OS specific API, you can only customise it in the source code.

Code: Select all

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Windows
    ;
  CompilerCase #PB_OS_Linux
    ;
  CompilerCase #PB_OS_MacOS
    ;
CompilerEndSelect
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
damn
New User
New User
Posts: 9
Joined: Wed Mar 07, 2018 11:12 am

Re: How to determine cross-platform OS architecture?

Post by damn »

I know how separate code for each platform with compiler conditions. But I need a methods for linux and mac. This is problem for me.
User avatar
jacdelad
Addict
Addict
Posts: 1993
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: How to determine cross-platform OS architecture?

Post by jacdelad »

Your question is not clear. Can you ask it in another way?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: How to determine cross-platform OS architecture?

Post by Bitblazer »

damn wrote: Sun Aug 06, 2023 11:32 am I know how to do it on Windows OS, but not on Linux and MacOS.
Linux system information includes a classic textmode shell version. The source is included too, so you can rip what you need :)

I hope i understood your question correctly, it is a bit vague.
damn
New User
New User
Posts: 9
Joined: Wed Mar 07, 2018 11:12 am

Re: How to determine cross-platform OS architecture?

Post by damn »

Sorry for my English =(.

For example:

Code: Select all

Procedure.a is64()
	Protected Info.SYSTEM_INFO
		
	GetNativeSystemInfo(Info)
		
	If info\wProcessorArchitecture
		ProcedureReturn #True
	EndIf
		
	ProcedureReturn #False
EndProcedure
This code work fine for Windows OS, but I need some code like this for other OS.
Post Reply