From b033b039d62ed233894b85d4bf9f5f8dbaf34197 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 6 Dec 1998 22:18:17 +0000 Subject: [PATCH] Redefine putenv before including stdlib.h to work around Solaris 2.7's conflicting prototype. Reported by Karl Berry. --- lib/putenv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/putenv.c b/lib/putenv.c index f1974d50f5..77f720f82d 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -31,8 +31,14 @@ #include #if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H) +/* Some stdlib.h (e.g., Solaris 2.7) declare putenv with a non-const argument. + Since that would conflict with the declaration below, we rename putenv in + that incompatible prototype. */ +# define putenv vendor_putenv_prototype # include +# undef putenv #endif + #if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H) # include #endif @@ -60,8 +66,7 @@ extern char **environ; /* Put STRING, which is of the form "NAME=VALUE", in the environment. */ int -rpl_putenv (string) - const char *string; +rpl_putenv (const char *string) { const char *const name_end = strchr (string, '='); register size_t size; -- 2.30.2