filter-graph: make sure strdupa is defined

Fixes #4756
This commit is contained in:
Wim Taymans 2025-06-17 15:17:07 +02:00
parent b57b87abbb
commit a6199c92a4

View file

@ -351,6 +351,15 @@ static struct node *find_node(struct graph *graph, const char *name)
} }
return NULL; 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: /* find a port by name. Valid syntax is:
* "<node_name>:<port_name>" * "<node_name>:<port_name>"