From: William Lallemand Date: Fri, 23 Aug 2024 17:33:22 +0000 (+0200) Subject: BUILD: tools: environ is not defined in OS X and BSD X-Git-Tag: v3.1-dev7~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a03ab426f80e1e1840dc94b0b94464f6a439541;p=thirdparty%2Fhaproxy.git 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 --- 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.