[libvirt] [PATCH python] define __GNUC_PREREQ macro before using it

We brought over use of the __GNUC_PREREQ macro from libvirt but didn't bring over the definition of it. This brings over the macro from libvirt sources. --- libvirt-utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libvirt-utils.h b/libvirt-utils.h index f55be7b..add7553 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -65,6 +65,15 @@ # endif # ifdef __GNUC__ + +# ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj,min) 0 +# endif + /** * ATTRIBUTE_UNUSED: * -- 1.8.3.2

On Dec 29, 2013, at 4:52 PM, Doug Goldstein <cardoe@cardoe.com> wrote:
We brought over use of the __GNUC_PREREQ macro from libvirt but didn't bring over the definition of it. This brings over the macro from libvirt sources. --- libvirt-utils.h | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/libvirt-utils.h b/libvirt-utils.h index f55be7b..add7553 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -65,6 +65,15 @@ # endif
# ifdef __GNUC__ + +# ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj,min) 0 +# endif + /** * ATTRIBUTE_UNUSED: * -- 1.8.3.2
Embarrassingly I didn't git add the missing #endif before I did a git commit --amend so it didn't appear here. But if this is ACK'd rest assured, I've fixed it locally.

Doug Goldstein wrote:
On Dec 29, 2013, at 4:52 PM, Doug Goldstein <cardoe@cardoe.com> wrote:
We brought over use of the __GNUC_PREREQ macro from libvirt but didn't bring over the definition of it. This brings over the macro from libvirt sources. --- libvirt-utils.h | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/libvirt-utils.h b/libvirt-utils.h index f55be7b..add7553 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -65,6 +65,15 @@ # endif
# ifdef __GNUC__ + +# ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj,min) 0 +# endif + /** * ATTRIBUTE_UNUSED: * -- 1.8.3.2
Embarrassingly I didn't git add the missing #endif before I did a git commit --amend so it didn't appear here. But if this is ACK'd rest assured, I've fixed it locally.
Just for the record, this patch (with adding #endif) fixes build for me as well. Roman Bogorodskiy

On 12/29/2013 03:52 PM, Doug Goldstein wrote:
We brought over use of the __GNUC_PREREQ macro from libvirt but didn't bring over the definition of it. This brings over the macro from libvirt sources. --- libvirt-utils.h | 9 +++++++++ 1 file changed, 9 insertions(+)
ACK (with #endif fixed).
diff --git a/libvirt-utils.h b/libvirt-utils.h index f55be7b..add7553 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -65,6 +65,15 @@ # endif
# ifdef __GNUC__ + +# ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj,min) 0
Copy and paste and all, but you could add a space after that comma for consistency.
+# endif + /** * ATTRIBUTE_UNUSED: *
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, Dec 31, 2013 at 8:26 AM, Eric Blake <eblake@redhat.com> wrote:
On 12/29/2013 03:52 PM, Doug Goldstein wrote:
We brought over use of the __GNUC_PREREQ macro from libvirt but didn't bring over the definition of it. This brings over the macro from libvirt sources. --- libvirt-utils.h | 9 +++++++++ 1 file changed, 9 insertions(+)
ACK (with #endif fixed).
diff --git a/libvirt-utils.h b/libvirt-utils.h index f55be7b..add7553 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -65,6 +65,15 @@ # endif
# ifdef __GNUC__ + +# ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj,min) 0
Copy and paste and all, but you could add a space after that comma for consistency.
+# endif + /** * ATTRIBUTE_UNUSED: *
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Pushed with the fixes. Thanks all. -- Doug Goldstein
participants (3)
-
Doug Goldstein
-
Eric Blake
-
Roman Bogorodskiy