> On Jan 17, 2017, at 17:42, Daniel Eischen <deisc...@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

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to