This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to detect Host os is Linux or windows in c code of CCS?

In Normal c program below code works fine. If i compile this in Linux machine then it will print linux and if i compile it in windows then it will print windows.

How can i get same thing in C code going to compile in CCS on windows and CCS on Linux.

#ifdef linux
printf("its linux");
#else
printf("its windows");
#endif