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

Ngie Cooper (yaneurabeya) yaneurabeya at gmail.com
Wed Jan 18 01:55:39 UTC 2017


> On Jan 17, 2017, at 17:42, Daniel Eischen <deischen at freebsd.org> wrote:
> 
> 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.

	I’m not saying enums would be a bad idea, but it would require more work on the autoconf end as well, and would make testing for these symbols' support a little less straightforward.
	Maybe a combination of #define’s for determining whether or not the support is present, i.e. for simple #ifdef folks (I would probably only use one though), and having a sample for testing for support in autoconf in some products would be beneficial?
Thanks,
-Ngie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20170117/042f3204/attachment.sig>


More information about the svn-src-head mailing list