From 7a03ab426f80e1e1840dc94b0b94464f6a439541 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 23 Aug 2024 19:33:22 +0200 Subject: [PATCH] BUILD: tools: environ is not defined in OS X and BSD Add extern char **environ which in order to build the new functions to manipulate the environment. Indeed the variable environ is not required to be declared by POSIX, so it need to be declared manually: "In addition, the following variable, which must be declared by the user if it is to be used directly: extern char **environ;" https://pubs.opengroup.org/onlinepubs/9699919799/functions/environ.html --- src/tools.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools.c b/src/tools.c index 2b7c131653..39bb454e36 100644 --- a/src/tools.c +++ b/src/tools.c @@ -82,6 +82,8 @@ extern void *__elf_aux_vector; #include #include +extern char **environ; + /* This macro returns false if the test __x is false. Many * of the following parsing function must be abort the processing * if it returns 0, so this macro is useful for writing light code. -- 2.47.3