From b8e2a376e32991f433337ca777444ab73fee0e6e Mon Sep 17 00:00:00 2001 From: "Yury V. Zaytsev" Date: Tue, 8 Oct 2024 11:52:37 +0200 Subject: [PATCH] Ticket #4495: check if environ is defined to fix redefinition on Alpine Signed-off-by: Yury V. Zaytsev --- configure.ac | 4 ++++ lib/widget/input_complete.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 012fbd3fb..ae649b4a0 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,10 @@ dnl ############################################################################ dnl OS specific stuff dnl ############################################################################ +AC_CHECK_DECLS([environ], , , + [ #include + #include ]) + case $host_os in *os400) AC_PATH_PROG([PERL], [perl], [/QOpenSys/pkgs/bin/perl]) diff --git a/lib/widget/input_complete.c b/lib/widget/input_complete.c index cd0ccbc87..4d3fd8b4b 100644 --- a/lib/widget/input_complete.c +++ b/lib/widget/input_complete.c @@ -54,8 +54,7 @@ /*** global variables ****************************************************************************/ -/* Linux declares environ in , so don't repeat it here. */ -#if (!(defined(__linux__) && defined (__USE_GNU)) && !defined(__CYGWIN__)) +#if !HAVE_DECL_ENVIRON extern char **environ; #endif