Here's a pretty puzzle...
Zack Weinberg
zackw@Stanford.EDU
Tue Apr 17 01:24:00 GMT 2001
On Tue, Apr 17, 2001 at 05:48:06PM +1000, Fergus Henderson wrote:
> On 17-Apr-2001, Zack Weinberg <zackw@stanford.edu> wrote:
> > Suppose you have an untyped enumeration constant. Let's call it
> > N_OPT, to pick a value not entirely at random. It's supposed to be
> > defined in a system header, but it might not be. You want to provide
> > a default value for this constant only if the system header doesn't.
> > You can't use #ifdef, because it isn't a macro, it's only an
> > enumeration constant.
> >
> > Has anyone any idea how to do that in plain C?
> >
> > This isn't a hypothetical, this is something at least dbxout.c and
> > sdbout.c need to do.
>
> I don't think it's possible in plain C. But why not use an autoconf test?
Ugh, if we can't do something clever we should just use our own stab.h
unconditionally. Hmm...
zw
More information about the Gcc
mailing list