#if COMPILER == COMPILER_MSVC # define COMP_MESSAGE(x) #pragma message(x) #else COMPILER == _COMPILER_GNUC # define COMP_MESSAGE(x) ##warning x #endif
[quote=引用 5 楼 paschen 的回复:] 直接在需要使用这个宏的位置: #if COMPILER == COMPILER_MSVC #pragma message(x) #else COMPILER == _COMPILER_GNUC ##warning x #endif
直接在需要使用这个宏的位置: #if COMPILER == COMPILER_MSVC #pragma message(x) #else COMPILER == _COMPILER_GNUC ##warning x #endif
[quote=引用 1 楼 paschen 的回复:] 由于有#号,编译器把pragma当作一个宏参数了
由于有#号,编译器把pragma当作一个宏参数了
24,854
社区成员
27,343
社区内容
加载中
试试用AI创作助手写篇文章吧