changeset 14867:355e7137b2de

unsetenv: Avoid gcc warning. * lib/unsetenv.c (unsetenv): Provide declaration if system lacks it.
author Bruno Haible <bruno@clisp.org>
date Sun, 05 Jun 2011 14:32:56 +0200
parents 0d4d726862ca
children 3b0e2e72c0a2
files ChangeLog lib/unsetenv.c
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
--- a/lib/unsetenv.c
+++ b/lib/unsetenv.c
@@ -97,6 +97,13 @@
 #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.  */