diff options
author | Doug Goldstein <cardoe@cardoe.com> | 2013-11-13 14:37:22 -0600 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2013-11-22 14:44:48 +0000 |
commit | 01b7db975b13755de106d19b132c5a64f12dd704 (patch) | |
tree | 024128cbcaf293c41ceeb2fa2cabdc0aab3b910c | |
parent | 78b1835889a5c634bb10d9328bf387c6ef5546a8 (diff) | |
download | libvirt-python-v8-01b7db975b13755de106d19b132c5a64f12dd704.tar.gz libvirt-python-v8-01b7db975b13755de106d19b132c5a64f12dd704.tar.xz libvirt-python-v8-01b7db975b13755de106d19b132c5a64f12dd704.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.
-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 |