aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2015-04-22 12:35:54 -0700
committerJoel Brobecker <brobecker@adacore.com>2015-04-22 12:37:52 -0700
commitdfc0f57b741c12a94520c9ec7f726755eac1d2de (patch)
tree87f05aaf49ee6e26e6e8ad4ecb1e9479e9ad3680
parentf16eab5ffbd9128410241abc48edcd5871c91137 (diff)
downloadgdb-dfc0f57b741c12a94520c9ec7f726755eac1d2de.zip
gdb-dfc0f57b741c12a94520c9ec7f726755eac1d2de.tar.gz
gdb-dfc0f57b741c12a94520c9ec7f726755eac1d2de.tar.bz2
libiberty/setenv.c: Do not declare environ if defined as a macro.
Otherwise, it causes a build warning on some platforms such as MinGW. libiberty/ChangeLog (Eli Zaretskii <eliz@gnu.org>): * setenv.c <environ>: Declare only if not a macro.
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/setenv.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 22e3f85..5009807 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-22 Eli Zaretskii <eliz@gnu.org>
+
+ * setenv.c <environ>: Declare only if not a macro.
+
2015-01-19 Eli Zaretskii <eliz@gnu.org>
* strerror.c <sys_nerr, sys_errlist>: Declare only if they aren't
diff --git a/libiberty/setenv.c b/libiberty/setenv.c
index 96917d5..714ca0a 100644
--- a/libiberty/setenv.c
+++ b/libiberty/setenv.c
@@ -63,8 +63,10 @@ extern int errno;
#define __environ environ
#ifndef HAVE_ENVIRON_DECL
+#ifndef environ
extern char **environ;
#endif
+#endif
#undef setenv
#undef unsetenv