Is there an #ifdef stripping C/C++ utility -
this question has answer here:
is there utility can strip out #ifdef pro_version ... #endif
code?
please don't tell me visual studio compiler flag or xcode's view post-processed source. can't automate conveniently like, say, console application.
what looking here find existing utility if exists. if not ... guess i'll have reinvent wheel.
unifdef might you're looking for.
from its manual:
the unifdef utility acts on #if, #ifdef, #ifndef, #elif, #else, , #endif lines. directive processed if symbols specified on command line sufficient allow unifdef definite value control expression. if result false, directive , following lines under control removed. if result true, directive removed. #ifdef or #ifndef directive passed through unchanged if controlling symbol not specified on command line. #if or #elif control expression has unknown value or unifdef cannot parse passed through unchanged.
Comments
Post a Comment