【发布时间】:2015-02-21 09:13:52
【问题描述】:
有没有办法检查编译时使用的参数?
喜欢:
gcc -std=c99 -ggdb3 source.c -o sate-enak
在source.c:
...
#ifdef (-ggdb3 variable is defined)
do_some_function();
#else
do_another_function();
#endif
...
使用这种方法,我可以知道程序是为生产编译的还是产品编译的。
【问题讨论】:
标签: c gcc compilation c-preprocessor