aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-03-17 19:04:25 +0000
committerEli Zaretskii <eliz@gnu.org>2013-03-17 19:04:25 +0000
commit72edb7c28f204d6c0512612968482803747b6d4f (patch)
tree734f0adc3f64836aac38bfab15370ceb2466b07e
parent5f7b875afe6ac05a247e1ecec678cf6e1ec3a0d9 (diff)
downloadgdb-72edb7c28f204d6c0512612968482803747b6d4f.zip
gdb-72edb7c28f204d6c0512612968482803747b6d4f.tar.gz
gdb-72edb7c28f204d6c0512612968482803747b6d4f.tar.bz2
Fix compilation warning by MinGW GCC.
setenv.c [!HAVE_ENVIRON_DECL]: Avoid declaring environ if it is a macro, as this causes compiler warnings with MinGW.
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/setenv.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index b4c6180..fa921e4 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-17 Eli Zaretskii <eliz@gnu.org>
+
+ * setenv.c [!HAVE_ENVIRON_DECL]: Avoid declaring environ if it is
+ a macro, as this causes compiler warnings with MinGW.
+
2013-03-01 Andreas Schwab <schwab@linux-m68k.org>
* obstacks.texi (Obstacks): Trim @node to only contain the
diff --git a/libiberty/setenv.c b/libiberty/setenv.c
index 96917d5..921e968 100644
--- a/libiberty/setenv.c
+++ b/libiberty/setenv.c
@@ -63,8 +63,11 @@ extern int errno;
#define __environ environ
#ifndef HAVE_ENVIRON_DECL
+/* MinGW defines environ to call a function. */
+#ifndef environ
extern char **environ;
#endif
+#endif
#undef setenv
#undef unsetenv