diff --git a/textproc/libfyaml/Makefile b/textproc/libfyaml/Makefile index fe7b6acd467c..f5444b81477b 100644 --- a/textproc/libfyaml/Makefile +++ b/textproc/libfyaml/Makefile @@ -1,30 +1,31 @@ PORTNAME= libfyaml DISTVERSION= 0.9.6 +PORTREVISION= 1 CATEGORIES= textproc MASTER_SITES= https://github.com/pantoniou/libfyaml/releases/download/v${DISTVERSION}/ MAINTAINER= yuri@FreeBSD.org COMMENT= YAML parser and emitter WWW= https://github.com/pantoniou/libfyaml LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE TEST_DEPENDS= git:devel/git \ bash:shells/bash USES= gmake libtool shebangfix # will change to cmake soon USE_LDCONFIG= yes SHEBANG_FILES= test/testemitter.test GNU_CONFIGURE= yes INSTALL_TARGET= install-strip TEST_TARGET= check post-patch: ${GREP} -rl "#include " ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -E "s|#include |#include |" .include diff --git a/textproc/libfyaml/files/patch-include_libfyaml_libfyaml-atomics.h b/textproc/libfyaml/files/patch-include_libfyaml_libfyaml-atomics.h new file mode 100644 index 000000000000..d9cd1b2dfff5 --- /dev/null +++ b/textproc/libfyaml/files/patch-include_libfyaml_libfyaml-atomics.h @@ -0,0 +1,78 @@ +https://github.com/pantoniou/libfyaml/commit/1026d76850909dc9b1c5f95b8cd94e865a313fd5 + +--- include/libfyaml/libfyaml-atomics.h.orig 2026-03-15 13:48:50 UTC ++++ include/libfyaml/libfyaml-atomics.h +@@ -78,7 +78,7 @@ extern "C" { + #if !defined(FY_HAVE_C11_ATOMICS) + #undef FY_HAVE_STDATOMIC_H + +-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) ++#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(__cplusplus) + #define FY_HAVE_C11_ATOMICS + #elif defined(__clang__) && defined(__has_extension) + #if __has_extension(c_atomic) +@@ -123,7 +123,7 @@ typedef bool atomic_flag; + + #define atomic_store(_ptr, _val) \ + do { \ +- *(_obj) = (_val); \ ++ *(_ptr) = (_val); \ + } while(0) + + #define atomic_exchange(_ptr, _v) \ +@@ -152,6 +152,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_add(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr += (_v); \ + __old; \ +@@ -159,6 +160,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_sub(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr -= (_v); \ + __old; \ +@@ -166,6 +168,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_or(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr |= (_v); \ + __old; \ +@@ -173,6 +176,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_xor(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr ^= (_v); \ + __old; \ +@@ -180,6 +184,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_and(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr &= (_v); \ + __old; \ +@@ -199,13 +204,14 @@ typedef bool atomic_flag; + #define atomic_flag_test_and_set(_ptr) \ + ({ \ + volatile atomic_flag *__ptr = (_ptr); \ ++ bool __ret; \ + if (!*__ptr) { \ + *__ptr = true; \ + __ret = true; \ + } else \ + __ret = false; \ + __ret; \ +- } ++ }) + + #endif +