From cf1f2ab81ded096b194b5b54a7ee14102f59ee62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Sun, 2 Jun 2019 12:42:16 +0200 Subject: Fix warn_unused_result for clang < 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Rühsen --- lib/gnutls_int.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h index bb49885978..f5a6477852 100644 --- a/lib/gnutls_int.h +++ b/lib/gnutls_int.h @@ -59,6 +59,8 @@ typedef int ssize_t; #ifdef __clang_major # define _GNUTLS_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +#else +# define _GNUTLS_CLANG_VERSION 0 #endif /* clang also defines __GNUC__. It promotes a GCC version of 4.2.1. */ @@ -82,7 +84,7 @@ typedef int ssize_t; # define G_GNUC_WGET_NONNULL(a) #endif -#if _GNUTLS_GCC_VERSION >= 30400 +#if _GNUTLS_GCC_VERSION >= 30400 && (_GNUTLS_CLANG_VERSION == 0 || _GNUTLS_CLANG_VERSION >= 40000) # define warn_unused_result __attribute__((warn_unused_result)) #else # define warn_unused_result -- cgit v1.2.1