summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-09-24 15:38:22 +0300
committerEli Zaretskii <eliz@gnu.org>2016-09-24 15:38:22 +0300
commit727c2b4c7011c252fd1973358629cccbfecfc25d (patch)
tree6f23f76a951b594921e7161a5035cace9f46683c
parent9cfede253d3d5f6907a6a1c0263b08442267cd55 (diff)
downloadgawk-727c2b4c7011c252fd1973358629cccbfecfc25d.tar.gz
Fix compilation warnings on MinGW with the latest runtime
reported by Marc de Bourget <marcdebourget@gmail.com>.
-rw-r--r--ChangeLog6
-rw-r--r--debug.c4
-rw-r--r--pc/ChangeLog15
-rw-r--r--pc/config.h2
-rw-r--r--pc/config.sed1
-rw-r--r--pc/socket.h5
6 files changed, 31 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4352c4bc..ad1de788 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-24 Eli Zaretskii <eliz@gnu.org>
+
+ * debug.c (restart) [__MINGW32__]: Cast 2nd argument of execvp to
+ avoid compiler warnings about prototype mismatch. Reported by
+ Marc de Bourget <marcdebourget@gmail.com>.
+
2016-09-08 Arnold D. Robbins <arnold@skeeve.com>
* command.y: Update license text to version 3. Oops.
diff --git a/debug.c b/debug.c
index 665775d5..6d40cac5 100644
--- a/debug.c
+++ b/debug.c
@@ -2902,7 +2902,11 @@ restart(bool run)
close_all();
/* start a new process replacing the current process */
+#ifdef __MINGW32__
+ execvp(d_argv[0], (const char * const *)d_argv);
+#else
execvp(d_argv[0], d_argv);
+#endif
/* execvp failed !!! */
fprintf(out_fp, _("Failed to restart debugger"));
diff --git a/pc/ChangeLog b/pc/ChangeLog
index b2d4eddb..7ba5fd9c 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,18 @@
+2016-09-24 Eli Zaretskii <eliz@gnu.org>
+
+ Fix compilation warnings on MinGW with the latest runtime.
+ Reported by Marc de Bourget <marcdebourget@gmail.com>.
+
+ * socket.h (_WIN32_WINNT): If it's already defined, redefine it
+ only if the value is less than what we need. This avoids compiler
+ warnings about redefinitions.
+
+ * config.h (HAVE_STRINGS_H): Define to 1.
+
+ * config.sed: Define STRINGS_H as well, as MinGW runtime 3.22 and
+ later needs that to get the prototypes of strcasecmp and
+ strncasecmp.
+
2016-09-08 Scott Deifik <scottd.mail@sbcglobal.net>
* Makefile.tst: Sync with mainline.
diff --git a/pc/config.h b/pc/config.h
index e166c53b..d584973a 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -261,7 +261,7 @@
#define HAVE_STRINGIZE 1
/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
diff --git a/pc/config.sed b/pc/config.sed
index 6c1fb3ab..a95ee2ef 100644
--- a/pc/config.sed
+++ b/pc/config.sed
@@ -155,6 +155,7 @@ s/^#undef HAVE_STRERROR *$/#define HAVE_STRERROR 1/
#define HAVE_STRFTIME 1\
#endif
s/^#undef HAVE_STRINGIZE *$/#define HAVE_STRINGIZE 1/
+s/^#undef HAVE_STRINGS_H *$/#define HAVE_STRINGS_H 1/
s/^#undef HAVE_STRING_H *$/#define HAVE_STRING_H 1/
/^#undef HAVE_STRNCASECMP *$/c\
#define HAVE_STRNCASECMP 1\
diff --git a/pc/socket.h b/pc/socket.h
index 41dd23cf..d7b890dd 100644
--- a/pc/socket.h
+++ b/pc/socket.h
@@ -7,7 +7,10 @@
#include <io.h>
-#define _WIN32_WINNT 0x501
+#if !defined _WIN32_WINNT || _WIN32_WINNT < 0x501
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x501
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>