X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fignore-value.h;h=52804dc23b375b37969dfb698e53811baffcc917;hb=939dedd9a2fba934e5ff0313155f9f5f39cb6f6f;hp=8f60b0e60d5e244000db8499992e05d7f7744e43;hpb=456a9f9a86c8b4e71f38003027dfbaa45c19bf20;p=pspp diff --git a/lib/ignore-value.h b/lib/ignore-value.h index 8f60b0e60d..52804dc23b 100644 --- a/lib/ignore-value.h +++ b/lib/ignore-value.h @@ -47,13 +47,14 @@ # endif # endif -static inline void _ignore_value (intptr_t p) { (void) p; } -# define ignore_value(x) _ignore_value ((intptr_t) x) +# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1) +# define ignore_value(x) ((void) (x)) +# else +# define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; })) +# endif /* ignore_value works for both scalars and pointers; deprecate ignore_ptr. */ static inline void ATTRIBUTE_DEPRECATED ignore_ptr (void *p) { (void) p; } /* deprecated: use ignore_value */ -/* FIXME: what about aggregate types? */ - #endif