svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg

Daniel Eischen deischen at freebsd.org
Wed Jan 18 01:43:59 UTC 2017


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


More information about the svn-src-head mailing list