使用-std = c ++ 0x标志编译下面的代码时,unix宏变为未定义且错误"Unix未定义!" 显示.是否有任何理由发生这种情况以及如何解决这个问题?在gcc版本4.7.2和4.8.4中验证.
#include <iostream>
#if !defined(unix)
#error Unix is not defined!
#endif
int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)