Since #ifdef
, #ifndef
and #endif
are preprocessor's directives, these will be applied before the compilation starts, ignoring the following lines completely in case _WINDOWS
is defined:
#ifndef _WINDOWS
if(condition)
{
printf("to do in linux");
}
else
#endif
Note that the condition
will be evaluated only in case it is not on Windows.
On Windows, there will be nothing but the following nested anonymous scope:
{
printf("should work in both linux and windows...");
}