diff options
author | Doug Goldstein <cardoe@cardoe.com> | 2013-11-13 14:37:22 -0600 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2013-11-21 16:37:07 +0000 |
commit | 90d1c56af5a942ae58ddd1dcb3ccc0b72097a589 (patch) | |
tree | 1a301960e8930a29ff68ce32d535f61e08d32eac /libvirt-utils.h | |
parent | 290296921150e08b2aa6aa641fab0b489a4adeb1 (diff) | |
download | libvirt-python-v7-90d1c56af5a942ae58ddd1dcb3ccc0b72097a589.tar.gz libvirt-python-v7-90d1c56af5a942ae58ddd1dcb3ccc0b72097a589.tar.xz libvirt-python-v7-90d1c56af5a942ae58ddd1dcb3ccc0b72097a589.zip |
Import LIBVIR_CHECK_VERSION macro from libvirt
Add LIBVIR_CHECK_VERSION from libvirt upstream so that we can check the
version of the library we are compiling against and support a range of
libvirt versions. The macro was added to libvirt in 1.2.0 so we must
provide it if its not defined.
Diffstat (limited to 'libvirt-utils.h')
-rw-r--r-- | libvirt-utils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libvirt-utils.h b/libvirt-utils.h index 795f678..447e81f 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -28,6 +28,16 @@ # define MIN(a,b) (((a) < (b)) ? (a) : (b)) # endif +/** + * libvirt.h provides this as of version 1.1.5, but we want to be able + * to support older versions of libvirt so copy and paste the macro from + * libvirt.h + */ +# ifndef LIBVIR_CHECK_VERSION +# define LIBVIR_CHECK_VERSION(major, minor, micro) \ + ((major) * 1000000 + (minor) * 1000 + (micro) <= LIBVIR_VERSION_NUMBER) +# endif + /* Return 1 if an array of N objects, each of size S, cannot exist due to size arithmetic overflow. S must be positive and N must be nonnegative. This is a macro, not a function, so that it |