From 727c2b4c7011c252fd1973358629cccbfecfc25d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 24 Sep 2016 15:38:22 +0300 Subject: Fix compilation warnings on MinGW with the latest runtime reported by Marc de Bourget . --- pc/ChangeLog | 15 +++++++++++++++ pc/config.h | 2 +- pc/config.sed | 1 + pc/socket.h | 5 ++++- 4 files changed, 21 insertions(+), 2 deletions(-) (limited to 'pc') 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 + + Fix compilation warnings on MinGW with the latest runtime. + Reported by Marc de Bourget . + + * 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 * 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 header file. */ -#undef HAVE_STRINGS_H +#define HAVE_STRINGS_H 1 /* Define to 1 if you have the 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 -#define _WIN32_WINNT 0x501 +#if !defined _WIN32_WINNT || _WIN32_WINNT < 0x501 +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x501 +#endif #include #include -- cgit v1.2.3