Recursively remove preprocessor macros

六月ゝ 毕业季﹏ 提交于 2019-12-02 19:01:26

问题


I have a source tree for a program I am working on which is written in mixed C/C++ code. For debugging purposes, I would like to be able to run a command line tool like unifdef on the entire tree (recursively) to remove a certain set of #ifdef/#endif macros from all source files.

I was wondering if there was any specific way I could go about doing this in an efficient way. Any help would be appriciated, thank you.


回答1:


I've solved this issue by using the following command:

find . -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.hpp' -exec unifdef <macro definitions> -o '{} {} ;'



来源:https://stackoverflow.com/questions/43833971/recursively-remove-preprocessor-macros

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!