diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2013-11-12 18:21:50 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2013-11-21 16:37:07 +0000 |
commit | c7c830e3da1a2bb605f6fd1832a2dc71097fb1b4 (patch) | |
tree | 2553ca96a5f759be2564b5befd79eb61f5a83ddd /libvirt-utils.h | |
parent | 5fb9567edf7777b00d3171e1ab018c6585c1e55a (diff) | |
download | libvirt-python-v7-c7c830e3da1a2bb605f6fd1832a2dc71097fb1b4.tar.gz libvirt-python-v7-c7c830e3da1a2bb605f6fd1832a2dc71097fb1b4.tar.xz libvirt-python-v7-c7c830e3da1a2bb605f6fd1832a2dc71097fb1b4.zip |
Import gnulib's ignore_value macro
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'libvirt-utils.h')
-rw-r--r-- | libvirt-utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libvirt-utils.h b/libvirt-utils.h index c1223fd..961cc20 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -43,4 +43,15 @@ # define xalloc_oversized(n, s) \ ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) + +/* The __attribute__((__warn_unused_result__)) feature + is available in gcc versions 3.4 and newer, + while the typeof feature has been available since 2.7 at least. */ +# if 3 < __GNUC__ + (4 <= __GNUC_MINOR__) +# define ignore_value(x) \ + (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; })) +# else +# define ignore_value(x) ((void) (x)) +# endif + #endif /* __LIBVIRT_UTILS_H__ */ |