From 4033d1fd0f25196f9a35e944679676277cd51960 Mon Sep 17 00:00:00 2001 From: Alex Burmashev Date: Wed, 10 Mar 2021 08:49:54 -0500 Subject: Fix compilation for older gcc Signed-off-by: Alex Burmashev --- include/compiler.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/compiler.h') diff --git a/include/compiler.h b/include/compiler.h index 40358a11..18576724 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -18,7 +18,11 @@ # define RETURNS_NONNULL #else # define NONNULL(first, args...) __attribute__((__nonnull__(first, ## args))) +#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))) # define RETURNS_NONNULL __attribute__((__returns_nonnull__)) +#else +# define RETURNS_NONNULL +#endif #endif #ifndef UNUSED -- cgit v1.2.3