我正在发布另一个我无法解决的编程任务。假设我们编写了特定于操作系统的预处理指令,如:
#if OS == Linux
/* Linux-specific instructions */
...
#else
#if OS == Darwin
/* Mac OSX-specific instructions */
...
#else
/* Program code for other OS */
...
#endif
#endif
我们不允许使用#define OS Linux;,而应该使用编译器(或者在makefile中)设置变量OS。还应该有