From a6199c92a4d8e7ed2be9c602e5857d95f3aed012 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 17 Jun 2025 15:17:07 +0200 Subject: [PATCH] filter-graph: make sure strdupa is defined Fixes #4756 --- spa/plugins/filter-graph/filter-graph.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spa/plugins/filter-graph/filter-graph.c b/spa/plugins/filter-graph/filter-graph.c index fa3cc980e..ed90f48e4 100644 --- a/spa/plugins/filter-graph/filter-graph.c +++ b/spa/plugins/filter-graph/filter-graph.c @@ -351,6 +351,15 @@ static struct node *find_node(struct graph *graph, const char *name) } return NULL; } +#if !defined(strdupa) +# define strdupa(s) \ + ({ \ + const char *__old = (s); \ + size_t __len = strlen(__old) + 1; \ + char *__new = (char *) alloca(__len); \ + (char *) memcpy(__new, __old, __len); \ + }) +#endif /* find a port by name. Valid syntax is: * ":"