Dynamic macro expansion through a pipe?
Tom Tromey
tromey@redhat.com
Wed Feb 20 15:58:00 GMT 2008
>>>>> "Philipp" == Philipp Marek <philipp@marek.priv.at> writes:
Philipp> I'm looking for a nice solution.
I think this note is off-topic for the gcc list. gcc-help may be more
appropriate.
Philipp> - I could try #define C(x) uncompress(buffer##__LINE__) and
Philipp> write some script that looks for the C() calls and generates
Philipp> a C file with the buffer constants - which means parsing
Philipp> (some of) C.
Aside from the compression this is what xgettext does, more or less.
You could modify it to suit your needs.
Philipp> - Or, what I'd like best: Is there some way to tell GCC
Philipp> "whenever this macro is used, call program X, and substitute
Philipp> the macro value with the output"? That would be the easiest
Philipp> way for me.
This is very unlikely to happen, sorry.
Tom
More information about the Gcc
mailing list