]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix warn_unused_result for clang < 4
authorTim Rühsen <tim.ruehsen@gmx.de>
Sun, 2 Jun 2019 10:42:16 +0000 (12:42 +0200)
committerTim Rühsen <tim.ruehsen@gmx.de>
Sun, 2 Jun 2019 10:42:16 +0000 (12:42 +0200)
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
lib/gnutls_int.h

index bb4988597855d933d2d65e9453c6965203409b09..f5a6477852a86d707370800432c2f050380e5549 100644 (file)
@@ -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