cross posted at 8052.com I have a module, which is used in four different products, that has way too many #ifdef's to be readable in debug and, at the same time, there is so much common code that making four separate modules is not the right approach. I have used all the "usual tricks" (separating what is only for one to a separate libray module, making some conditionals inside a macro etc) What I wonder is: is there some software that can "cut type x" out of the source before compilation. Since I am using a .bat operation (no IDE), a free standing program would be fine. This, probably, would require replacing the #ifdef with somrthing such a program "understood" no problem. Erik just so you know: I can NOT use the IDE due to its inability to make lots of slightly different builds in one go from the same source. Not a complaint, just a fact.
m4 was the traditional Unix solution when you needed a slightly more powerful macro processor. Unfortunately, using it would mean your source wasn't really C any more; it's not just an upwardly compatible version of the C preprocessor. You'd add an m4 step before presenting the files to the compiler. On the bright side, the other code would never be seen by the C toolchain, so there's no way it could wind up in the debugger. m4 -> C -> C preprocessor -> compile -> link. http://www.gnu.org/software/m4/