]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Don't define HAVE_ENVIRON_DECL when environ is unavailable
authorJordan Williams <jordan@jwillikers.com>
Fri, 29 Mar 2024 21:56:43 +0000 (16:56 -0500)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Apr 2024 06:33:24 +0000 (08:33 +0200)
HAVE_ENVIRON_DECL is being defined to 0 by cfg_data.set10().
The code only checks whether or not is defined.
This leads to it not being declared appropriately.
Use cfg_data.set() instead of cfg_data.set10() to define it when true.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 640754e29475a22fb19082dbd5cd587edc05e4b7)

meson.build

index bc335709d1e83d29b97208b9202e138831526025..a5328e873d95b065961aac34e1dbeda19f95ec64 100644 (file)
@@ -452,7 +452,7 @@ have_cpu_set_t = cc.sizeof('cpu_set_t', prefix : '#define _GNU_SOURCE\n#include
 conf.set('HAVE_CPU_SET_T', have_cpu_set_t ? 1 : false)
 
 have = cc.has_header_symbol('unistd.h', 'environ', args : '-D_GNU_SOURCE')
-conf.set10('HAVE_ENVIRON_DECL', have)
+conf.set('HAVE_ENVIRON_DECL', have ? 1 : false)
 
 have = cc.has_header_symbol('signal.h', 'sighandler_t', args : '-D_GNU_SOURCE')
 conf.set('HAVE_SIGHANDLER_T', have ? 1 : false)