[libvirt] [PATCHv2] build: correctly check for SOICGIFVLAN GET_VLAN_VID_CMD command
Eric Blake
eblake at redhat.com
Tue Feb 11 04:30:50 UTC 2014
On 02/10/2014 05:10 PM, Laine Stump wrote:
>>
>> AC_CHECK_DECLS unconditionally defines the variable to either 0 or 1, so
>> checking if it is defined will still fail to compile on older headers
>> that lack the enum;
>
> Well, it would have compiled successfully, but compiled the wrong code :-)
>
>> what you want is to check that it has a non-zero value.
>
> Now that I've seen this, it bugs me that all HAVE_* #defines aren't
> consistent about this - some are undefined if the capability is missing,
> and some are #defined, but to 0.
It's historical baggage of autoconf - the various checks were written at
different times, but autoconf can't change the older checks to always
define the macro because of back-compat. The general rule of thumb is
HAVE_DECL_ is always defined, any other HAVE_ is likely undefined if the
feature is missing.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140210/7f4ae7b8/attachment-0001.sig>
More information about the libvir-list
mailing list