cross platform application howto detect operating system

Find quick help here to get you started with Hollywood
Post Reply
Olaf
Posts: 2
Joined: Fri Feb 24, 2023 9:10 pm

cross platform application howto detect operating system

Post 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
p-OS
Posts: 167
Joined: Mon Nov 01, 2010 11:56 pm

Re: cross platform application howto detect operating system

Post 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.
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: cross platform application howto detect operating system

Post 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.
Olaf
Posts: 2
Joined: Fri Feb 24, 2023 9:10 pm

Re: cross platform application howto detect operating system

Post by Olaf »

Thank you very much for the answers. Very helpful, of course, thanks.
Post Reply