Here's a pretty puzzle...

Zack Weinberg zackw@stanford.edu
Tue Apr 17 00:03:00 GMT 2001


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.

zw



More information about the Gcc mailing list