Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jan 2017 20:42:17 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Maxim Sobolev <sobomax@freebsd.org>
Cc:        Ian Lepore <ian@freebsd.org>, "Conrad E. Meyer" <cem@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: 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
Message-ID:  <Pine.GSO.4.64.1701172039390.15850@sea.ntplx.net>
In-Reply-To: <CAH7qZfuCPWeZ8OzkZKq0sp5A_Xuy-z=6jDWzrvehC5MMi1dugQ@mail.gmail.com>
References:  <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <CAH7qZftckckygNG3HRqikiaGds6FsOedUR7AWKGi-PJg96FQjA@mail.gmail.com> <CAH7qZftsYAoBj7gFpOMHgT9a12N1yshAGY%2BkAEkpbTks7LL29Q@mail.gmail.com> <20170117212713.GZ2611@FreeBSD.org> <CAH7qZfuu7SWG7Ff7k1BU6ChwwA4SqC%2BG%2BcTHjtjEr%2BAS_Q5p0g@mail.gmail.com> <CAG6CVpXTVucnJUXzx%2B7VPPHkw-AptwSdNCjnz2QsTrgewGqKVA@mail.gmail.com> <1484697145.86335.183.camel@freebsd.org> <CAH7qZfuCPWeZ8OzkZKq0sp5A_Xuy-z=6jDWzrvehC5MMi1dugQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1701172039390.15850>