Move more predefined macros
Neil Booth
neil@daikokuya.demon.co.uk
Wed May 15 23:24:00 GMT 2002
Zack Weinberg wrote:-
> This patch moves the definition of __REGISTER_PREFIX__,
> __USER_LABEL_PREFIX__, and __VERSION__ into c-common.c, and eliminates
> __HAVE_BUILTIN_SETJMP__. It also adjusts the way the
> STDC_0_IN_SYSTEM_HEADERS hack works so that it does not require
> #ifdeffage in cpplib.
Nice.
> No target-specific code is affected. Neil, I'd like your opinion on
> the aesthetics of the change to builtin_define_with_value; should the
> flag parameter be two separate functions instead?
It's not pretty, but OK for now I guess. Probably two functions would
be better.
> Future potential changes along these lines are: move the
> builtin_define_* routines from c-common to cpplib (they are
> semi-duplicates of internal cpplib routines); move the definitions of
> __cplusplus etc to c-common. I'd appreciate opinions on both.
I'm thinking of having a new interface in cpplib that takes the
macro and its expansion separately. At present, we just burn cycles
copying the string, replacing the first '=', and then letting the
lexer separate them out again.
It might be nicer to just to a cpp_lookup() on the name and jump
straight into lexing the definition.
Neil.
More information about the Gcc-patches
mailing list