On Tue, 17 Jan 2017, Maxim Sobolev wrote:
Also there is at least one thing that makes enum less desirable from the
point of view of application developer. Particularly it makes it impossible
to use preprocessor to do a conditional compilation, which is especially
important for the FreeBSD-specific options. With the "old" way, I can
easily have something like:
#if defined(SO_TS_CLOCK)
...
setsockopt(SO_TS_CLOCK, ...);
#else
[do something else]
#endif
This does not work with enums for obvious reasons, one would need to resort
to using some kind of autoconfigure mechanism to figure out if the enum in
question is defined.
Great point, we (at $JOB) have code that this, and would break
if changed to enums.
--
DE
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"