From 4c509f3635d092f59237ad381163082b207a419a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 5 Jun 2011 14:32:56 +0200 Subject: [PATCH] unsetenv: Avoid gcc warning. * lib/unsetenv.c (unsetenv): Provide declaration if system lacks it. (cherry picked from commit 6f88ff35bd7cbf4d48212a0eda501613c595904d) --- ChangeLog | 5 +++++ lib/unsetenv.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index b8bfb2be5..754cfa2f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-06-05 Bruno Haible + unsetenv: Avoid gcc warning. + * lib/unsetenv.c (unsetenv): Provide declaration if system lacks it. + +2011-06-05 Bruno Haible + setenv: Avoid gcc warning. * lib/setenv.c (setenv): Provide declaration if system lacks it. diff --git a/lib/unsetenv.c b/lib/unsetenv.c index 215bba064..16b50d15e 100644 --- a/lib/unsetenv.c +++ b/lib/unsetenv.c @@ -97,6 +97,13 @@ weak_alias (__unsetenv, unsetenv) #else /* HAVE_UNSETENV */ # undef unsetenv +# if !HAVE_DECL_UNSETENV +# if VOID_UNSETENV +extern void unsetenv (const char *); +# else +extern int unsetenv (const char *); +# endif +# endif /* Call the underlying unsetenv, in case there is hidden bookkeeping that needs updating beyond just modifying environ. */ -- 2.11.0