You did not say why you
cannot change # to // in these directives
I think you have tools or scripts depending on them. You must update them to follow the current standard.
Perhaps a more unique or incredible suffix can help you, for example, use //#COMMENT instead of #COMMENT
But, in essence, you are asking a more or less standard matching compiler to understand a non-standard and outdated language function, and this is essentially hopeless.
Alternatively, you can fix the recent GCC source code (e.g. GCC 4.6) to fit your requirements, but I don't think it is a very good idea (and even GCC 4.6 plugins do not help here, since there are no hook plugins in its preprocessor )
My advice, as before, is to change the source code to meet current standards. This almost never leads to a loss of time.
source share