Linux C++ 条件编译
部分旧代码升级到C++11,发现以前的#ifdef linux不起作用了。
调查发现,linux C++11中,并没有定义linux这个宏。需要使用__linux__进行替换。
StackOverflow地址如下
c++ - How to identify platform/compiler from preprocessor macros? - Stack Overflow
部分旧代码升级到C++11,发现以前的#ifdef linux不起作用了。
调查发现,linux C++11中,并没有定义linux这个宏。需要使用__linux__进行替换。
StackOverflow地址如下
c++ - How to identify platform/compiler from preprocessor macros? - Stack Overflow