【发布时间】:2019-09-27 16:53:57
【问题描述】:
假设我有一个包含如下行的头文件:
#if LONG_BIT != 8 * SIZEOF_LONG
/* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent
* 32-bit platforms using gcc. We try to catch that here at compile-time
* rather than waiting for integer multiplication to trigger bogus
* overflows.
*/
#error "pp897: LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#endif
我想输出 LONG_BIT 和 SIZEOF_LONG 的值。有可能做到这一点,还是从头文件中不可能做到这一点?
【问题讨论】:
-
不,它们不是变量,而是常量。但是,您仍然可以使用 std::cout 输出它们
-
@Lehks 添加这只是给了我:/awips2/python/include/python2.7/pyport.h:900:1:错误:命名空间“std”中的“cout”没有命名类型std::cout
-
@EricPostpischil 那么预处理器宏可以输出还是不能输出?
标签: c c-preprocessor