This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH (libstdc++-v3): Fix libstdc++/7680 (and a reference fixfor the dynamic visibility of C99 features in system headers)
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Cc: gdr at integrable-solutions dot net, phil at jaj dot com, CLR004 at motorola dot com, gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Tue, 15 Apr 2003 18:21:36 -0700
- Subject: Re: PATCH (libstdc++-v3): Fix libstdc++/7680 (and a reference fixfor the dynamic visibility of C99 features in system headers)
- References: <200304160031.h3G0VpBt043952@latour.rsch.comm.mot.com>
Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com> writes:
>>I'm wondering how much typing you would save with CPP...
>
> I wondered the same thing. How do I put a #if region inside a macro
> defined with #define?
>
> I need to define something like this to tighten it:
>
> #define _GLIBCXX_C99_BIND(a,b) \
> #if (a) \
> using ::b; \
> #endif \
This, I'm afraid, is completely impossible.
If you want to talk about extensions to allow it, I would suggest that
you instead allow
if (a) using ::b;
where (a) is an integer-constant-expression. This is a limited form
of the 'if-goes-everywhere' functionality I've been thinking about off
and on - the idea is to supersede #if completely (except for excluding
other preprocessing directives), by allowing if (x) { ... } anywhere,
as long as x is an integer constant expression, and then adding
builtin predicates that evaluate all the sorts of things you want to
test at compile time.
zw