Re: 如何移除特定的 conditional compilation?
※ 引述《roylee.bbs@bbs.cs.nctu.edu.tw (roylee)》之銘言:
> prog.c
> -------------------
> #include <stdio.h>
> #ifdef FOO
> void foo(){ ...}
> #endif
> #ifdef BAR
> void bar(){ ...}
> #endif
> int main(){ ... }
> 請問有沒有只移除 FOO conditional compilation 的方法?
> 使得 prog.c 簡化成:
> #include <stdio.h>
> #ifdef BAR
> void bar(){ ...}
> #endif
> int main(){ ... }
> 最好是用 gcc / cpp 可以直接做到
> 如果有其他工具也歡迎
> 謝謝
不懂妳的問題
因為#就是complier direct的指令了
不然你把程式改為
#undefine FOO
#ifdef FOO
void foo(){ ...}
#endif
or
#if 0
void foo(){ ...}
#endif
吧
不知道有沒有回答到妳的問題
--
※發信站 [中央數學 織夢天堂 bbs.math.ncu.edu.tw]
‧FROM [how 從 218-168-222-3.dynamic.hinet.net 發表]
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章