PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Precompiler tool

I'm looking for a tool (or method to force an existing compiler) to apply all precompiler directives to a C/C++ source file and spit out a new C/C++ source file.

For example, the original:
Code:

#define TEST 1234

#ifdef TEST
int i=TEST;
#else
int i=0;
#endif


The tool would produce:
Code:

int i=1234;


Same thing with #includes, etc, they would all be resolved and removed.

Dan East
gnu cpp (C preprocessor) will do this.
It's only the macro processor.


Jon
Your compiler (VC6, EVC, VC7) already does this, just look up "/p" in the help.
Thierry wrote:Your compiler (VC6, EVC, VC7) already does this, just look up "/p" in the help.


Thanks, that's what I was looking for (combined with /EP).

Dan East