Files
gentoo/dev-libs/aml/files/aml-0.3.0-queue.patch
James Le Cuirot fb1defa69d dev-libs/aml: Bump to 0.3.0, drop old 0.2.2, fixes 9999
We previously dropped the bundled queue.h in favour of the system-wide version
to fix musl. However, 0.3.0 uses a macro that only appears in the bundled
version (from FreeBSD?), so patch that back in.

Bug: https://bugs.gentoo.org/828806
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2023-03-19 10:45:54 +00:00

22 lines
713 B
Diff

The bundled queue.h breaks on musl, but the standard version lacks
LIST_FOREACH_SAFE, which appears to come from FreeBSD, so patch that back
in here. See https://github.com/any1/aml/issues/11.
diff -Naur a/src/aml.c b/src/aml.c
--- a/src/aml.c 2023-01-22 12:57:53.000000000 +0000
+++ b/src/aml.c 2023-03-19 10:10:11.034092428 +0000
@@ -31,6 +31,13 @@
#include "sys/queue.h"
#include "thread-pool.h"
+#ifndef LIST_FOREACH_SAFE
+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = LIST_FIRST((head)); \
+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+#endif
+
#define EXPORT __attribute__((visibility("default")))
#define EVENT_MASK_DEFAULT AML_EVENT_READ