Can you use something like awk instead of CPP? Add a few flags to the code surrounding the piece of code you want to remove. For instance:
(...) //BEGIN_REMOVE_THIS_CODE printf("secret code"); //END_REMOVE_THIS_CODE (...)
then write awk script to remove this code, something like ...
BEGIN { write=1;} /^\/\/BEGIN_REMOVE_THIS_CODE/ { write=0; next;} /^\/\/END_REMOVE_THIS_CODE/ { write=1; next;} { if(write==1) print $0; }
source share