This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: PATCH (libstdc++-v3): Fix libstdc++/7680 (and a reference fix for the dynamic visibility of C99 features in system headers)


On Tue, Apr 15, 2003 at 06:49:44PM -0700, Zack Weinberg wrote:
> Gabriel Dos Reis <gdr at integrable-solutions dot net> writes:
> 
> > Zack Weinberg <zack at codesourcery dot com> writes:
> > | 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.

It seems to me you can say

  #define _USING_0(b)
  #define _USING_1(b) using ::b;
  #define _USING(a,b) _USING_##a(b)
  #define _GLIBCXX_C99_BIND(a,b) _USING(a, b)

  #define _USE_FOO 1  // yes
  #define _USE_BAR 0  // no
  #define _USE_BAZ 1  // yes

  _GLIBCXX_C99_BIND(_USE_FOO, foo)  // yes
  _GLIBCXX_C99_BIND(_USE_BAR, bar)  // no
  _GLIBCXX_C99_BIND(_USE_BAZ, baz)  // yes

but maybe I don't understand the problem well enough.

Nathan Myers
ncm-nospam at cantrip dot org


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