Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个小小的代码和平
#ifdef QA || DEBUG do something #endif
创建以下错误:
#ifdef 指令末尾的额外标记
我尝试移除一根管道,但不起作用。谷歌只显示与 cpp 无关的类似问题的答案。
任何想法?
利用:
#if defined(A) || defined(B) // do stuff #endif
或嵌套条件
#ifdef A #ifdef B // do stuff #endif #endif