I need to figure out the operating system my program is running on during runtime.
I'm using Qt 4.8.1, MinGW. My program shall run a command-line QProcess on Windows or Linux. Now I need a kind of switch to run the different code depending on the operating system. I'm aware of macros like Q_OS_WIN23
, Q_OS_LINUX
and etc. But I don't know how to switch the part of code while compiling it, so that depending on OS it ignored irrelevant one? Could you show via snippet?
Thanks beforehand!