Define-away putenv only if it's not already defined.
authorJim Meyering <jim@meyering.net>
Sun, 29 Jun 1997 20:12:52 +0000 (20:12 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 29 Jun 1997 20:12:52 +0000 (20:12 +0000)
lib/putenv.c

index df2f39f..5e9a863 100644 (file)
 #endif
 
 /* Define-away any (possibly conflicting) prototype of putenv.
-   Many systems omit the `const' attribute on the argument.  */
-#define putenv _sys_putenv
+   Many systems omit the `const' attribute on the argument.
+   Define-away only if it's not already defined (e.g. to rpl_putenv).  */
+#ifndef putenv
+# define putenv _sys_putenv
+#endif
 
 #if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H)
 # include <stdlib.h>
@@ -37,7 +40,9 @@
 # include <unistd.h>
 #endif
 
-#undef putenv
+#ifndef putenv
+# undef putenv
+#endif
 
 #if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR)
 # define strchr index