Here's a pretty puzzle...
Fergus Henderson
fjh@cs.mu.oz.au
Tue Apr 17 00:48:00 GMT 2001
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?
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh > | -- the last words of T. S. Garp.
More information about the Gcc
mailing list