unsetenv: Avoid gcc warning.
authorBruno Haible <bruno@clisp.org>
Sun, 5 Jun 2011 12:32:56 +0000 (14:32 +0200)
committerIan Beckwith <ianb@erislabs.net>
Thu, 9 Jun 2011 23:36:27 +0000 (00:36 +0100)
* lib/unsetenv.c (unsetenv): Provide declaration if system lacks it.
(cherry picked from commit 6f88ff35bd7cbf4d48212a0eda501613c595904d)

ChangeLog
lib/unsetenv.c

index b8bfb2b..754cfa2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-06-05  Bruno Haible  <bruno@clisp.org>
 
+       unsetenv: Avoid gcc warning.
+       * lib/unsetenv.c (unsetenv): Provide declaration if system lacks it.
+
+2011-06-05  Bruno Haible  <bruno@clisp.org>
+
        setenv: Avoid gcc warning.
        * lib/setenv.c (setenv): Provide declaration if system lacks it.
 
index 215bba0..16b50d1 100644 (file)
@@ -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.  */