In my C++ file, I have
#ifdef DEBUG
then blah
#else
blooh.
I want to strip out all text that does not get compiled after preprocessing, so that if DEBUG is not defined, then all statement of the form:
#ifdef DBUG
/* some debug code */
#endif
gets stripped out of the source.
EDIT: Here is an example :
#include <iostream>
//#define DEBUG
int main(){
#ifdef DEBUG
cout << "In debug\n";
#endif
cout << "hello\n";
return 0;
}
And after running the script , the output should be
#include <iostream>
//#define DEBUG
int main(){
cout << "hello\n";
return 0;
}
Is just running the preprocessor not good enough? For example
g++ -E?