summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2013-09-09 10:02:28 +0100
committerDaniel P. Berrange <berrange@redhat.com>2013-09-09 16:42:02 +0100
commit5ce207ba7d04ed922cc9c29a3fac436998ee59a5 (patch)
tree782d62fa373f3f3bffb292a3f34d33ffdacd7388
parentde0c5b13f7f2058f90dfd6425b3d337f137759fd (diff)
downloadlibvirt-python-split-5ce207ba7d04ed922cc9c29a3fac436998ee59a5.zip
libvirt-python-split-5ce207ba7d04ed922cc9c29a3fac436998ee59a5.tar.gz
libvirt-python-split-5ce207ba7d04ed922cc9c29a3fac436998ee59a5.tar.xz
Import gnulib's ignore_value macro
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rw-r--r--libvirt-override.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index acd06a6..c2c1c18 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -51,6 +51,17 @@ extern void initcygvirtmod(void);
#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
+
+
#if 0
# define DEBUG_ERROR 1
#endif