From eb25c3da07e8066f5ece673635f9c89ea9b6c7c2 Mon Sep 17 00:00:00 2001 From: Fergus Dall Date: Thu, 24 Sep 2020 18:08:39 +1000 Subject: [PATCH] dev-libs/ustr: Fix compilation using clang/LLVM This package depends on old-style GCC inline functions, but the patch to maintain this behaviour on newer compilers only works for GCC specifically. Replace this with a check for __GNUC_STDC_INLINE__, which is documented to work with both GCC and clang. Closes: https://bugs.gentoo.org/732026 Signed-off-by: Fergus Dall --- .../ustr/files/ustr-1.0.4-inline-check.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 dev-libs/ustr/files/ustr-1.0.4-inline-check.patch diff --git a/dev-libs/ustr/files/ustr-1.0.4-inline-check.patch b/dev-libs/ustr/files/ustr-1.0.4-inline-check.patch new file mode 100644 index 0000000000..b38cf7829c --- /dev/null +++ b/dev-libs/ustr/files/ustr-1.0.4-inline-check.patch @@ -0,0 +1,27 @@ +--- a/ustr-conf.h.in 2007-10-22 08:00:55.000000000 +0200 ++++ b/ustr-conf.h.in 2015-09-10 12:24:34.998796842 +0200 +@@ -4,13 +4,23 @@ + /* this is the custom version for the library itself, for everyone else + * ustr-import generates one depending on the options. */ + ++/* Ustr relies on GCC's traditional handling of inline functions, not ++ * the version that was actually standardized in C99. GCC-compatible ++ * compilers define __GNUC_STDC_INLINE__ when using the standard ++ * behavior. When this is set we must restore the old inline behavior: ++ */ ++#if defined(__GNUC__) \ ++ && defined(__GNUC_STDC_INLINE__) ++# define inline inline __attribute__ ((gnu_inline)) ++#endif ++ + /* The default is now to link against libc. */ + #ifndef USTR_CONF_INCLUDE_CODEONLY_HEADERS + #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 0 + #endif + + /* We can't: if defined(__GLIBC__) && (!defined(_GNU_SOURCE) || !_GNU_SOURCE) +- * because by the time we've included a libc header it's too late. */ ++ * because by the time we've included a libc header it's too late. */ + #ifndef _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif -- 2.28.0.681.g6f77f65b4e-goog