J
jvankay
Does any C guru out there know of a C pre-processing tool that will allow
limited pruning of C source based on a single #define variable.
That is, in the code fragment below:
XXX
#ifdef UndesirableTag
YYY
#ifdef TagB
ZZZ
#endif
AAA
#endif
BBB
#ifdef TagC
CCC.
#endif
DDD
If "UndesirableTag" and all of its code is to be removed from a file (with
other #defines in it), then the outer #ifdef and the code all the way to the
2nd #endif inclusive should be removed, but nothing else touched.
Cpp is not suitable because it will remove all the defines and inline the
#includes. Ideally the tool will handle ifdef, ifndef, else, elif, endif,
if Defined, if expr, and nested ifs. We need this for a project with many
source files and many defines in the project.
Anyone know of a tool that will do this, or something close to this?
Any help would be appreciated. Please email to (e-mail address removed).
Thanks and best regards.
limited pruning of C source based on a single #define variable.
That is, in the code fragment below:
XXX
#ifdef UndesirableTag
YYY
#ifdef TagB
ZZZ
#endif
AAA
#endif
BBB
#ifdef TagC
CCC.
#endif
DDD
If "UndesirableTag" and all of its code is to be removed from a file (with
other #defines in it), then the outer #ifdef and the code all the way to the
2nd #endif inclusive should be removed, but nothing else touched.
Cpp is not suitable because it will remove all the defines and inline the
#includes. Ideally the tool will handle ifdef, ifndef, else, elif, endif,
if Defined, if expr, and nested ifs. We need this for a project with many
source files and many defines in the project.
Anyone know of a tool that will do this, or something close to this?
Any help would be appreciated. Please email to (e-mail address removed).
Thanks and best regards.