This is the mail archive of the
mailing list for the glibc project.
Re: [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 19 Nov 2014 15:47:07 -0800 (PST)
- Subject: Re: [ping][PATCH 04/19] Use MODULE_NAME in stap-probe instead of IN_LIB
- Authentication-results: sourceware.org; auth=none
- References: <1408618663-2281-1-git-send-email-siddhesh at redhat dot com> <1408618663-2281-5-git-send-email-siddhesh at redhat dot com> <20140917124715 dot GW6586 at spoyarek dot pnq dot redhat dot com> <20141107233206 dot B655F2C3B00 at topped-with-meat dot com> <20141119070959 dot GI7942 at spoyarek dot pnq dot redhat dot com>
> > 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.