This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB


> > Why is this better than just putting -DMODULE_NAME=... in CPPFLAGS
> > as with IN_MODULE?  In fact, you could pass only -DMODULE_NAME=...
> > and then use PASTE(MODULE_,MODULE_NAME).
> 
> I don't think that is possible.  We cannot paste macro definitions.
> That is, I cannot do:
> 
> #define MODULE_ ## libc 42

I'm not sure what you imagine I imagine that would do.  What I'm talking
about is -DMODULE_NAME=libc instead of -DIN_MODULE=MODULE_libc and:

#define IN_MODULE PASTE(MODULE_, MODULE_NAME)
#define PASTE(a, b) PASTE_1(a, b)
#define PASTE_1(a, b) a##b

instead of generating #if IN_MODULE == ... #define MODULE_NAME ... #endif.
Of course the "#define MODULE_foo N" bit has to be generated.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]