]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: tools: environ is not defined in OS X and BSD
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 23 Aug 2024 17:33:22 +0000 (19:33 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 23 Aug 2024 17:39:57 +0000 (19:39 +0200)
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

index 2b7c1316539fdef773604b0c4d5092367ffb3ff0..39bb454e367152564f58a961a2ad1400db06c76d 100644 (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.