Re: [PATCH v2] AC_HEADER_MAJOR: port to glibc 2.25

2016-09-14 Thread Zack Weinberg
Doh, one small correction:

> +@verbatim
> +#include 
> +#ifdef MAJOR_IN_MKDEV
> +# include 
> +#elif MAJOR_IN_SYSMACROS
> +# include 
> +#endif
> +@end verbatim

That should be `#elif defined MAJOR_IN_SYSMACROS`.  This was
originally my mistake and I just realized it _was_ a mistake, sorry.

(also applies to a couple of places in your gnulib patches)

zw



Re: [PATCH v2] AC_HEADER_MAJOR: port to glibc 2.25

2016-09-14 Thread Eric Blake
On 09/14/2016 08:14 PM, Zack Weinberg wrote:
> Doh, one small correction:
> 
>> +@verbatim
>> +#include 
>> +#ifdef MAJOR_IN_MKDEV
>> +# include 
>> +#elif MAJOR_IN_SYSMACROS
>> +# include 
>> +#endif
>> +@end verbatim
> 
> That should be `#elif defined MAJOR_IN_SYSMACROS`.  This was
> originally my mistake and I just realized it _was_ a mistake, sorry.
> 
> (also applies to a couple of places in your gnulib patches)

Good thing I haven't pushed yet!

You are correct that config.h either leaves those two macros undefined
or defines them to 1; so #if works as well as #ifdef, but only as long
as your compiler isn't warning about undefined macros used as
preprocessor conditionals during #if (C99 requires it to work, but it is
a very common warning to enable in gcc to prevent it as a lintian style
option).  So I could go either way as long as the two lines are
consistent, but the #ifdef approach seems less likely to bother people
that use the gcc warning.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [PATCH v2] AC_HEADER_MAJOR: port to glibc 2.25

2016-09-14 Thread Zack Weinberg
On Wed, Sep 14, 2016 at 3:00 PM, Eric Blake  wrote:
>
> Thanks for the wordsmithing help, and forcing me to think about
> mingw. This version updates some wording, and changes the macro
> to leave the relative order of mkdev.h vs. sysmacros.h checking
> unchanged (by merely weakining the sys/types.h check to no longer
> care whether the macros are present).

This version looks good to me.

zw