From 0a166474f80ca43fe08e610a75c843b3c14988ef Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Jun 2021 14:15:22 +0200 Subject: [PATCH 1/3] Don't include MSW headers in allheaders test This extends the changes of e0005c1d93 (No longer include the system headers first, 2021-04-22) to the platform-specific headers included for Cygwin/MinGW wxMSW builds, as this shouldn't be necessary neither any more (but doing it for wxQt is still needed, for the reasons explained in the new comment added by this commit). It also incidentally fixes a problem in Cygwin build since enabling IPv6 in 8dfcb582da (Regenerate configure after enabling IPv6 support by default, 2021-06-15) as including unistd.h directly results in warnings if wx/defs.h, which predefines __USE_W32_SOCKETS, hadn't been included before. --- tests/allheaders.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/allheaders.cpp b/tests/allheaders.cpp index 2663573da1..87cd9d58f3 100644 --- a/tests/allheaders.cpp +++ b/tests/allheaders.cpp @@ -38,18 +38,9 @@ #include "catch.hpp" -#if defined(__WXMSW__) - #include - - // Avoid warnings about redeclaring standard functions such as chmod() in - // various standard headers when using MinGW/Cygwin. - #if defined(__MINGW32__) || defined(__CYGWIN__) - #include - #include - #include - #include - #endif -#elif defined(__WXQT__) +#if defined(__WXQT__) + // Include this one before enabling the warnings as doing it later, as it + // happens when it's included from wx/fontutil.h, results in -Wsign-promo. #include #endif From c0f2430ee4578757fa5155595fe908d925086272 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Jun 2021 14:17:48 +0200 Subject: [PATCH 2/3] Correct misleading comment in allheaders test We don't use any HAVE_XXX here, but we do use wxUSE_XXX. --- tests/allheaders.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/allheaders.cpp b/tests/allheaders.cpp index 87cd9d58f3..2a78445bb2 100644 --- a/tests/allheaders.cpp +++ b/tests/allheaders.cpp @@ -33,7 +33,7 @@ _Pragma(STRINGIZE(GCC diagnostic ignored STRINGIZE(CONCAT(-W,warn)))) #endif -// We have to include this one first in order to check for HAVE_XXX below. +// We have to include this one first in order to check for wxUSE_XXX below. #include "wx/setup.h" #include "catch.hpp" From 3d7f9877fb9ec1e21d33c580323b55672beb085b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Jun 2021 16:44:24 +0100 Subject: [PATCH 3/3] Predefine __USE_W32_SOCKETS for Cygwin in allheaders test This is required to avoid warnings (and worse, probably) due to conflicting function declarations in the platform SDK and Cygwin headers that have started happening since 8dfcb582da (Regenerate configure after enabling IPv6 support by default, 2021-06-15). --- tests/allheaders.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/allheaders.cpp b/tests/allheaders.cpp index 2a78445bb2..1264104bbc 100644 --- a/tests/allheaders.cpp +++ b/tests/allheaders.cpp @@ -36,6 +36,13 @@ // We have to include this one first in order to check for wxUSE_XXX below. #include "wx/setup.h" +// Normally this is done in wx/defs.h, but as we don't include it here, we need +// to do it manually to avoid warnings inside the standard headers included +// from catch.hpp. +#if defined(__CYGWIN__) && defined(__WINDOWS__) + #define __USE_W32_SOCKETS +#endif + #include "catch.hpp" #if defined(__WXQT__)