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
This commit is contained in:
William Lallemand 2024-08-23 19:33:22 +02:00
parent 28ca7fc594
commit 430fd1d159
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ extern void *__elf_aux_vector;
#include <haproxy/tools.h>
#include <haproxy/xxhash.h>
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.