diff --git a/devel/libcyaml/Portfile b/devel/libcyaml/Portfile index e2d05071f39b4..09f81f35a3e6c 100644 --- a/devel/libcyaml/Portfile +++ b/devel/libcyaml/Portfile @@ -26,6 +26,9 @@ checksums rmd160 b3ed61d7d628188055fc5a7927171605d236f581 \ sha256 8dbd216e1fce90f9f7cca341e5178710adc76ee360a7793ef867edb28f3e4130 \ size 86791 +# https://github.com/tlsa/libcyaml/pull/231 +patchfiles-append 0001-data.h-use-_Static_assert-when-static_assert-undefin.patch + compiler.c_standard 2011 depends_lib-append port:libyaml diff --git a/devel/libcyaml/files/0001-data.h-use-_Static_assert-when-static_assert-undefin.patch b/devel/libcyaml/files/0001-data.h-use-_Static_assert-when-static_assert-undefin.patch new file mode 100644 index 0000000000000..e65991e966086 --- /dev/null +++ b/devel/libcyaml/files/0001-data.h-use-_Static_assert-when-static_assert-undefin.patch @@ -0,0 +1,28 @@ +From 2a5f98ed1d4d8e8b8c6c1850c5cbbe29dff08c94 Mon Sep 17 00:00:00 2001 +From: barracuda156 +Date: Wed, 22 May 2024 14:43:57 +0800 +Subject: [PATCH] data.h: use _Static_assert when static_assert undefined + +Fixes: https://github.com/tlsa/libcyaml/issues/230 +--- + src/data.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git src/data.h src/data.h +index 8b76a9c..4a00e4f 100644 +--- src/data.h ++++ src/data.h +@@ -12,6 +12,13 @@ + #ifndef CYAML_DATA_H + #define CYAML_DATA_H + ++#include ++#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \ ++ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ ++ && __STDC_VERSION__ <= 201710L ++#define static_assert _Static_assert ++#endif ++ + #include "cyaml/cyaml.h" + #include "util.h" +