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.
インクルード/定義されたすべてのヘッダー ファイルをループしてから、#undefそれらすべてをループする方法はありますか?
#undef
ループが問題である場合#undef、それらすべてを簡単に行う別の方法はありますか?
GNU cppは、まさにそれを行うための-dMディレクティブを提供します。すべての定義をリストできます:
gcc -E -dM -c foo.c
次に、sedスクリプトを使用して、コマンドラインでそれらの定義を解除できます:)
gcc -E -c foo.c | sed's /#define /#undef /'
または何でもします...
楽しんで :)