>>>> "SJT" == Stephen J Turnbull
<turnbull(a)sk.tsukuba.ac.jp> writes:
SJT> What's wrong with #if defined(FEATURE)?
If you have a simple
#if ...
...
#endif
we use
#ifdef FEATURE
fairly consistently.
SJT> In the stuff I'm doing to encapsulate UTF-2000, I have a lot of
SJT> #if defined(UTF2000)
SJT> /* handle UTF-8 bufbytes and UCS-4 emchars */
SJT> #elif defined(MULE)
SJT> /* handle leading byte representation */
SJT> #else
SJT> /* --wthout-mule case */
SJT> #endif
SJT> I'm not terribly happy with it, but it's the most readable idiom I've
SJT> come up with. I use #ifdef for two-way branches; that helps to
SJT> visually distinguish the multibranch case. Is that unacceptable?
For multi-way switches where you have to use defined() for the #elif
anyways, your solution is more readable - I would do it your way.
Martin