# HG changeset patch # User Jim Meyering # Date 912982697 0 # Node ID 44617e0f6ffe250d8010c452d0505cb079ed08ef # Parent 26ad240c2ee226bab2bb9452882592e80a7327c7 Redefine putenv before including stdlib.h to work around Solaris 2.7's conflicting prototype. Reported by Karl Berry. diff --git a/lib/putenv.c b/lib/putenv.c --- 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 @@ /* 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;