Running different piece of code on different platforms like linux ,windows and android
Solved
General and Desktop
-
Hi all,
i want to execute a particular piece of code only on windows and some piece of code only on linux(similarly for android ).now my question is is there any macro flags are there to achieve this (or any other method is there also fine)
i want to execute code as below example
Ex : #ifdef linux_Os_platform
code_1
#ifdef windows_os_platform
code_2
#ifdef android_os_platform
code_3thanks !!
-
sure is
#if defined(Q_OS_IOS) //Ios #elif defined(Q_OS_MACOS) //Macos #elif defined(Q_OS_WIN) //Windows #elif defined(Q_OS_ANDROID) //Android #else ..... #endif
-
here, a more refined article than a quick copy&past from my current project :-)
-
@divaindie
Super please set as Solved :)