递归删除预处理器宏 [英] Recursively remove preprocessor macros

查看:74
本文介绍了递归删除预处理器宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在使用的程序的源代码树,该树是用C/C ++混合代码编写的.为了进行调试,我希望能够在整个树上(递归地)运行像 unifdef 这样的命令行工具,以删除某些#ifdef/#endif 集合.所有源文件中的宏.

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.

推荐答案

我已经通过使用以下命令解决了此问题:

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

find.-name'* .c'-o -name'* .h'-o -name'* .cpp'-o -name'* .hpp'-exec unifdef<宏定义>-o'{} {};'

这篇关于递归删除预处理器宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆