commit:     a7dfda3569459f3ea16b905260e22a3115bfc595
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 13 14:05:59 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 13 14:06:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7dfda35

net-libs/nghttp2: fix build (of tests) w/ c23

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../nghttp2/files/nghttp2-1.64.0-munit-c23.patch   | 28 ++++++++++++++++++++++
 net-libs/nghttp2/nghttp2-1.64.0.ebuild             |  4 ++++
 2 files changed, 32 insertions(+)

diff --git a/net-libs/nghttp2/files/nghttp2-1.64.0-munit-c23.patch 
b/net-libs/nghttp2/files/nghttp2-1.64.0-munit-c23.patch
new file mode 100644
index 000000000000..93d208fa4215
--- /dev/null
+++ b/net-libs/nghttp2/files/nghttp2-1.64.0-munit-c23.patch
@@ -0,0 +1,28 @@
+https://github.com/nemequ/munit/pull/105
+--- a/tests/munit/munit.c
++++ b/tests/munit/munit.c
+@@ -858,23 +858,18 @@ static psnip_uint64_t munit_clock_get_elapsed(struct 
PsnipClockTimespec *start,
+ 
+ #if defined(_OPENMP)
+ #  define ATOMIC_UINT32_T uint32_t
+-#  define ATOMIC_UINT32_INIT(x) (x)
+ #elif defined(HAVE_STDATOMIC)
+ #  include <stdatomic.h>
+ #  define ATOMIC_UINT32_T _Atomic uint32_t
+-#  define ATOMIC_UINT32_INIT(x) ATOMIC_VAR_INIT(x)
+ #elif defined(HAVE_CLANG_ATOMICS)
+ #  define ATOMIC_UINT32_T _Atomic uint32_t
+-#  define ATOMIC_UINT32_INIT(x) (x)
+ #elif defined(_WIN32)
+ #  define ATOMIC_UINT32_T volatile LONG
+-#  define ATOMIC_UINT32_INIT(x) (x)
+ #else
+ #  define ATOMIC_UINT32_T volatile uint32_t
+-#  define ATOMIC_UINT32_INIT(x) (x)
+ #endif
+ 
+-static ATOMIC_UINT32_T munit_rand_state = ATOMIC_UINT32_INIT(42);
++static ATOMIC_UINT32_T munit_rand_state = 42;
+ 
+ #if defined(_OPENMP)
+ static inline void munit_atomic_store(ATOMIC_UINT32_T *dest,

diff --git a/net-libs/nghttp2/nghttp2-1.64.0.ebuild 
b/net-libs/nghttp2/nghttp2-1.64.0.ebuild
index 040b77645d76..1c37ea0ab83d 100644
--- a/net-libs/nghttp2/nghttp2-1.64.0.ebuild
+++ b/net-libs/nghttp2/nghttp2-1.64.0.ebuild
@@ -34,6 +34,10 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.64.0-munit-c23.patch
+)
+
 multilib_src_configure() {
        #TODO: enable HTTP3
        #requires quictls/openssl, libngtcp2, libngtcp2_crypto_quictls, 
libnghttp3

Reply via email to