Page 1 of 1

cross platform application howto detect operating system

Posted: Thu Mar 09, 2023 3:52 pm
by Olaf
Hello all,
i'm completely new to Hollywood. I'm working mainly on Linux and Windows.

My application will use Execute() and/or Run() and i plan to write single source which i want to compile for win and lin.

parameters of the functions require different format, depending on currently running OS.

So the running application has to know which OS it runs on.

Is there a HW function like getCurrentPlatform or so?
Or do I have code myself a recognition workaround like watching output of existing hw funcs like getSystemInfo UserHome or so?

Or is there a typical hollywood way to do it?

Regards, Olaf

Re: cross platform application howto detect operating system

Posted: Thu Mar 09, 2023 5:35 pm
by p-OS
Check the manual for preprocessort command IF, there uis an example how to do conditional compilation depending on the paltform it is running.

Re: cross platform application howto detect operating system

Posted: Thu Mar 09, 2023 6:16 pm
by jPV
GetVersion() gives you a table with the Platform field:
Platform:
This is probably the most useful field because it contains the platform on which Hollywood is currently running. This field can be "AmigaOS3", "MorphOS", "WarpOS", "AmigaOS4", "AROS", "Win32", "MacOS", "Linux", "iOS", or "Android". Note that "Win32" is also returned for 64-bit Windows. It's called "Win32" for historical reasons.

Re: cross platform application howto detect operating system

Posted: Sat Mar 18, 2023 4:09 pm
by Olaf
Thank you very much for the answers. Very helpful, of course, thanks.