projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge with 1.8.1c
[gnulib.git]
/
lib
/
putenv.c
diff --git
a/lib/putenv.c
b/lib/putenv.c
index
512878c
..
c39d1b7
100644
(file)
--- a/
lib/putenv.c
+++ b/
lib/putenv.c
@@
-18,19
+18,30
@@
Cambridge, MA 02139, USA. */
#include <sys/types.h>
#include <errno.h>
#include <sys/types.h>
#include <errno.h>
-#ifdef STDC_HEADERS
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt. */
#include <stdlib.h>
#include <stdlib.h>
-#else
+#endif /* GNU C library. */
+
+#ifndef STDC_HEADERS
extern int errno;
#endif
extern int errno;
#endif
-#if defined(STDC_HEADERS) || defined(
USG
)
+#if defined(STDC_HEADERS) || defined(
HAVE_STRING_H
)
#include <string.h>
#include <string.h>
+#ifndef index
#define index strchr
#define index strchr
+#endif
+#ifndef bcopy
#define bcopy(s, d, n) memcpy((d), (s), (n))
#define bcopy(s, d, n) memcpy((d), (s), (n))
-#else /* not (STDC_HEADERS or USG) */
+#endif
+#else
#include <strings.h>
#include <strings.h>
-#endif
/* STDC_HEADERS or USG */
+#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@
-40,10
+51,6
@@
extern int errno;
#define NULL 0
#endif
#define NULL 0
#endif
-#if !__STDC__
-#define const
-#endif
-
extern char **environ;
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
extern char **environ;
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */