I've seen this asked but not answered:
I need to modify source code before the C++ compiler sees it, with
minimal user impact.
I see several approaches:
- Somebody said (January) that CW9 supports a new type of plugin that
can access the source between the preprocessor and the compiler. I
can find no reference to this anywhere in the SDK docs - is it for
real?
- Is it possible for one plugin to call another, i.e., a shim
"compiler" that would preprocess a file and then call the real
compiler to handle them? Ron, someone asked about this in December and
you said the engineers were gone for the holidays - was there an
answer that google can't find?
I've considered (but would prefer to avoid):
A perl script that processes the entire source tree on every build and
generates new source files that are added to the project. This might
actually be faster (since files could be cached) but seems messy.
Any thoughts?
Paul
<paul AT patchdance DOT com>
MW Ron - 04 Mar 2004 21:20 GMT
>I've seen this asked but not answered:
>
[quoted text clipped - 21 lines]
>
>Any thoughts?
If you look in the CodeWarrior SDK there is a sample preprocessor
project you should be able to use that to make your own plugin.
Ron

Signature
Announcing CodeWarrior Development Tools for Windows v9.2
http://www.metrowerks.com/MW/Develop/Desktop/Windows/Professional/Default.htm
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>
Ben Combee - 05 Mar 2004 03:40 GMT
> - Is it possible for one plugin to call another, i.e., a shim
> "compiler" that would preprocess a file and then call the real
> compiler to handle them? Ron, someone asked about this in December and
> you said the engineers were gone for the holidays - was there an
> answer that google can't find?
A compiler can process one file type, adding or updating a file in the
project. In the Palm OS world, there's one plugin that turns .rcp files
into .r files that then get built with Rez, and there's another
compiler, part of the Sybase Ultralite product, that processes SQL
statements into generated code. To use these, your source needs to have
a different extension to be associated with the other compiler.