From 416fc8582dfffaffb4b4bda7a1874f813fdeb3a6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Oct 2019 20:32:28 +0200 Subject: [PATCH 1/4] Remove unused code inside MSVC 6 version checks We don't support MSVC 6 (__VISUALC__ == 1200) or eVC (1201) since more than 5 years (see f4b80e533752448952cf181011d15e59061e8b9a), so it's useless to keep code compiled only when this compiler is used. --- include/msvc/wx/setup.h | 4 +--- include/wx/afterstd.h | 5 ----- include/wx/beforestd.h | 27 --------------------------- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/include/msvc/wx/setup.h b/include/msvc/wx/setup.h index 40217c9648..a83ef4b6e0 100644 --- a/include/msvc/wx/setup.h +++ b/include/msvc/wx/setup.h @@ -54,9 +54,7 @@ #ifdef wxMSVC_VERSION #define wxCOMPILER_PREFIX wxCONCAT(vc, wxMSVC_VERSION) #elif defined(wxMSVC_VERSION_AUTO) || defined(wxMSVC_VERSION_ABI_COMPAT) - #if _MSC_VER == 1200 - #define wxCOMPILER_PREFIX vc60 - #elif _MSC_VER == 1300 + #if _MSC_VER == 1300 #define wxCOMPILER_PREFIX vc70 #elif _MSC_VER == 1310 #define wxCOMPILER_PREFIX vc71 diff --git a/include/wx/afterstd.h b/include/wx/afterstd.h index 1c89d14758..8cb0fd19ca 100644 --- a/include/wx/afterstd.h +++ b/include/wx/afterstd.h @@ -16,11 +16,6 @@ #include "wx/msw/winundef.h" #endif -// undo what we did in wx/beforestd.h -#if defined(__VISUALC__) && __VISUALC__ <= 1201 - #pragma warning(pop) -#endif - // see beforestd.h for explanation #if defined(HAVE_VISIBILITY) && defined(HAVE_BROKEN_LIBSTDCXX_VISIBILITY) #pragma GCC visibility pop diff --git a/include/wx/beforestd.h b/include/wx/beforestd.h index 45c5b5bcba..c5a95da564 100644 --- a/include/wx/beforestd.h +++ b/include/wx/beforestd.h @@ -19,33 +19,6 @@ it can be included several times. */ -// VC 7.x isn't as bad as VC6 and doesn't give these warnings but eVC (which -// defines _MSC_VER as 1201) does need to be included as it's VC6-like -#if defined(__VISUALC__) && __VISUALC__ <= 1201 - // these warning have to be disabled and not just temporarily disabled - // because they will be given at the end of the compilation of the - // current source and there is absolutely nothing we can do about them so - // disable them before warning(push) below - - // 'foo': unreferenced inline function has been removed - #pragma warning(disable:4514) - - // 'function' : function not inlined - #pragma warning(disable:4710) - - // 'id': identifier was truncated to 'num' characters in the debug info - #pragma warning(disable:4786) - - // we have to disable (and reenable in afterstd.h) this one because, - // even though it is of level 4, it is not disabled by warning(push, 1) - // below for VC7.1! - - // unreachable code - #pragma warning(disable:4702) - - #pragma warning(push, 1) -#endif // VC++ < 7 - /** GCC's visibility support is broken for libstdc++ in some older versions (namely Debian/Ubuntu's GCC 4.1, see From fc711f869fcdd283fe60c5169b91b6254ec3b25f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Oct 2019 20:46:21 +0200 Subject: [PATCH 2/4] Remove obsolete wxUSE_IOSTREAMH option This is always 0 for any still supported compiler, so remove the option and configure checks for it. Still define it as 0 for compatibility, just in case it's used outside of the library. --- acinclude.m4 | 24 ---------------- build/cmake/setup.h.in | 3 -- configure | 38 ------------------------- configure.in | 3 -- docs/doxygen/mainpages/const_wxusedef.h | 1 - include/wx/android/setup.h | 12 -------- include/wx/defs.h | 17 ++--------- include/wx/gtk/setup0.h | 12 -------- include/wx/iosfwrap.h | 9 ++---- include/wx/ioswrap.h | 8 ++---- include/wx/motif/setup0.h | 12 -------- include/wx/msw/setup0.h | 12 -------- include/wx/osx/setup0.h | 12 -------- include/wx/platform.h | 29 ++----------------- include/wx/setup_inc.h | 12 -------- include/wx/univ/setup0.h | 12 -------- samples/typetest/typetest.cpp | 6 +--- setup.h.in | 3 -- src/common/docview.cpp | 8 ++---- src/common/variant.cpp | 6 +--- src/osx/cocoa/textctrl.mm | 6 +--- src/osx/iphone/textctrl.mm | 6 +--- src/osx/textctrl_osx.cpp | 6 +--- src/osx/textentry_osx.cpp | 6 +--- 24 files changed, 18 insertions(+), 245 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index a91268b5b8..97b4b26d1b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -184,30 +184,6 @@ dnl =========================================================================== dnl C++ features test dnl =========================================================================== -dnl --------------------------------------------------------------------------- -dnl WX_CPP_NEW_HEADERS checks whether the compiler has "new" header -dnl or only the old one - it may be generally assumed that if -dnl exists, the other "new" headers (without .h) exist too. -dnl -dnl call WX_CPP_NEW_HEADERS(action-if-true, action-if-false) -dnl --------------------------------------------------------------------------- - -AC_DEFUN([WX_CPP_NEW_HEADERS], -[ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - - AC_CHECK_HEADERS([iostream],,, [ ]) - - if test "$ac_cv_header_iostream" = "yes" ; then - ifelse([$1], , :, [$1]) - else - ifelse([$2], , :, [$2]) - fi - - AC_LANG_RESTORE -]) - dnl --------------------------------------------------------------------------- dnl WX_CHECK_FUNCS(FUNCTIONS..., dnl [ACTION-IF-FOUND], diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index af4d7326d7..2ee13d6522 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -222,9 +222,6 @@ #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -#cmakedefine01 wxUSE_IOSTREAMH - - #cmakedefine01 wxUSE_LONGLONG diff --git a/configure b/configure index 7e83754c38..b20869091b 100755 --- a/configure +++ b/configure @@ -20210,44 +20210,6 @@ $as_echo "#define HAVE_TYPE_TRAITS 1" >>confdefs.h else - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - for ac_header in iostream -do : - ac_fn_cxx_check_header_compile "$LINENO" "iostream" "ac_cv_header_iostream" " -" -if test "x$ac_cv_header_iostream" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IOSTREAM 1 -_ACEOF - -fi - -done - - - if test "$ac_cv_header_iostream" = "yes" ; then - : - else - $as_echo "#define wxUSE_IOSTREAMH 1" >>confdefs.h - - fi - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/configure.in b/configure.in index f361e85fda..7251023abf 100644 --- a/configure.in +++ b/configure.in @@ -1848,9 +1848,6 @@ AC_DEFINE(HAVE_TYPE_TRAITS) else dnl Not using C++11, so we do need to run the checks. -dnl check for iostream (as opposed to iostream.h) standard header -WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH)) - dnl the next few tests are all for C++ features and so need to be done using dnl C++ compiler AC_LANG_PUSH(C++) diff --git a/docs/doxygen/mainpages/const_wxusedef.h b/docs/doxygen/mainpages/const_wxusedef.h index ac407e9977..a34014a843 100644 --- a/docs/doxygen/mainpages/const_wxusedef.h +++ b/docs/doxygen/mainpages/const_wxusedef.h @@ -146,7 +146,6 @@ library: @itemdef{wxUSE_IMAGE, Use wxImage and related classes.} @itemdef{wxUSE_IMAGLIST, Use wxImageList class.} @itemdef{wxUSE_INTL, Use wxLocale and related classes.} -@itemdef{wxUSE_IOSTREAMH, Use header "iostream.h" instead of "iostream".} @itemdef{wxUSE_IPC, Use interprocess communication classes.} @itemdef{wxUSE_IPV6, Use experimental wxIPV6address and related classes.} @itemdef{wxUSE_JOYSTICK, Use wxJoystick class.} diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 029987479f..0055c63e43 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -391,18 +391,6 @@ // wxWidgets. #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -// VC++ 4.2 and above allows and but you can't mix -// them. Set this option to 1 to use , 0 to use . -// -// Note that newer compilers (including VC++ 7.1 and later) don't support -// wxUSE_IOSTREAMH == 1 and so will be used anyhow. -// -// Default is 0. -// -// Recommended setting: 0, only set to 1 if you use a really old compiler -#define wxUSE_IOSTREAMH 0 - - // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- diff --git a/include/wx/defs.h b/include/wx/defs.h index f35b9eea8a..a1c2ea5b15 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -460,21 +460,10 @@ typedef short int WXTYPE; /* Mingw <= 3.4 and all versions of Cygwin don't have std::wostream */ - #if (defined(__MINGW32__) && !wxCHECK_GCC_VERSION(4, 0)) || \ - defined(__CYGWIN__) - #define wxNO_WOSTREAM - #endif - - /* VC++ doesn't have it in the old iostream library */ - #if defined(__VISUALC__) && wxUSE_IOSTREAMH - #define wxNO_WOSTREAM - #endif - - #ifndef wxNO_WOSTREAM + #if (!defined(__MINGW32__) || wxCHECK_GCC_VERSION(4, 0)) && \ + !defined(__CYGWIN__) #define HAVE_WOSTREAM #endif - - #undef wxNO_WOSTREAM #endif /* HAVE_WOSTREAM */ /* ---------------------------------------------------------------------------- */ @@ -849,7 +838,7 @@ typedef short int WXTYPE; /* where should i put this? we need to make sure of this as it breaks */ /* the code. */ -#if !wxUSE_IOSTREAMH && defined(__WXDEBUG__) +#if defined(__WXDEBUG__) # undef wxUSE_DEBUG_NEW_ALWAYS # define wxUSE_DEBUG_NEW_ALWAYS 0 #endif diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index c581562c6b..715cea602a 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -392,18 +392,6 @@ // wxWidgets. #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -// VC++ 4.2 and above allows and but you can't mix -// them. Set this option to 1 to use , 0 to use . -// -// Note that newer compilers (including VC++ 7.1 and later) don't support -// wxUSE_IOSTREAMH == 1 and so will be used anyhow. -// -// Default is 0. -// -// Recommended setting: 0, only set to 1 if you use a really old compiler -#define wxUSE_IOSTREAMH 0 - - // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- diff --git a/include/wx/iosfwrap.h b/include/wx/iosfwrap.h index 13fb1f7f89..7379e75ce7 100644 --- a/include/wx/iosfwrap.h +++ b/include/wx/iosfwrap.h @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // Name: wx/iosfwrap.h -// Purpose: includes the correct stream-related forward declarations +// Purpose: This file is obsolete, include directly instead // Author: Jan van Dijk // Modified by: // Created: 18.12.2002 @@ -10,12 +10,7 @@ #if wxUSE_STD_IOSTREAM -#if wxUSE_IOSTREAMH - // There is no pre-ANSI iosfwd header so we include the full declarations. -# include -#else -# include -#endif +#include #ifdef __WINDOWS__ # include "wx/msw/winundef.h" diff --git a/include/wx/ioswrap.h b/include/wx/ioswrap.h index 5805588ead..7fad3b3d1b 100644 --- a/include/wx/ioswrap.h +++ b/include/wx/ioswrap.h @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // Name: wx/ioswrap.h -// Purpose: includes the correct iostream headers for current compiler +// Purpose: This file is obsolete, include directly instead. // Author: Vadim Zeitlin // Modified by: // Created: 03.02.99 @@ -12,11 +12,7 @@ #include "wx/beforestd.h" -#if wxUSE_IOSTREAMH -# include -#else -# include -#endif +#include #include "wx/afterstd.h" diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index fc4c657c01..5a5e8137ad 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -392,18 +392,6 @@ // wxWidgets. #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -// VC++ 4.2 and above allows and but you can't mix -// them. Set this option to 1 to use , 0 to use . -// -// Note that newer compilers (including VC++ 7.1 and later) don't support -// wxUSE_IOSTREAMH == 1 and so will be used anyhow. -// -// Default is 0. -// -// Recommended setting: 0, only set to 1 if you use a really old compiler -#define wxUSE_IOSTREAMH 0 - - // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index 7b502ecbef..1d1890f6cb 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -392,18 +392,6 @@ // wxWidgets. #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -// VC++ 4.2 and above allows and but you can't mix -// them. Set this option to 1 to use , 0 to use . -// -// Note that newer compilers (including VC++ 7.1 and later) don't support -// wxUSE_IOSTREAMH == 1 and so will be used anyhow. -// -// Default is 0. -// -// Recommended setting: 0, only set to 1 if you use a really old compiler -#define wxUSE_IOSTREAMH 0 - - // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index 49bf354be5..a04f3fad08 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -398,18 +398,6 @@ // wxWidgets. #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -// VC++ 4.2 and above allows and but you can't mix -// them. Set this option to 1 to use , 0 to use . -// -// Note that newer compilers (including VC++ 7.1 and later) don't support -// wxUSE_IOSTREAMH == 1 and so will be used anyhow. -// -// Default is 0. -// -// Recommended setting: 0, only set to 1 if you use a really old compiler -#define wxUSE_IOSTREAMH 0 - - // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- diff --git a/include/wx/platform.h b/include/wx/platform.h index d100c2b7ab..fccbedc0ae 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -529,32 +529,9 @@ #include "wx/chkconf.h" -/* - some compilers don't support iostream.h any longer, while some of theme - are not updated with yet, so override the users setting here - in such case. - */ -#if defined(_MSC_VER) && (_MSC_VER >= 1310) -# undef wxUSE_IOSTREAMH -# define wxUSE_IOSTREAMH 0 -#elif defined(__MINGW32__) -# undef wxUSE_IOSTREAMH -# define wxUSE_IOSTREAMH 0 -#endif /* compilers with/without iostream.h */ - -/* - old C++ headers (like ) declare classes in the global namespace - while the new, standard ones (like ) do it in std:: namespace, - unless it's an old gcc version. - - using this macro allows constuctions like "wxSTD iostream" to work in - either case - */ -#if !wxUSE_IOSTREAMH && (!defined(__GNUC__) || ( __GNUC__ > 2 ) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -# define wxSTD std:: -#else -# define wxSTD -#endif +/* These macros exist only for compatibility, don't use them in the new code */ +#define wxUSE_IOSTREAMH 0 +#define wxSTD std:: /* On OpenVMS with the most recent HP C++ compiler some function (i.e. wscanf) * are only available in the std-namespace. (BUG???) diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index bece6430b8..4706597287 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -388,18 +388,6 @@ // wxWidgets. #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -// VC++ 4.2 and above allows and but you can't mix -// them. Set this option to 1 to use , 0 to use . -// -// Note that newer compilers (including VC++ 7.1 and later) don't support -// wxUSE_IOSTREAMH == 1 and so will be used anyhow. -// -// Default is 0. -// -// Recommended setting: 0, only set to 1 if you use a really old compiler -#define wxUSE_IOSTREAMH 0 - - // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 0ebca727fd..c48db8d762 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -391,18 +391,6 @@ // wxWidgets. #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -// VC++ 4.2 and above allows and but you can't mix -// them. Set this option to 1 to use , 0 to use . -// -// Note that newer compilers (including VC++ 7.1 and later) don't support -// wxUSE_IOSTREAMH == 1 and so will be used anyhow. -// -// Default is 0. -// -// Recommended setting: 0, only set to 1 if you use a really old compiler -#define wxUSE_IOSTREAMH 0 - - // ---------------------------------------------------------------------------- // non GUI features selection // ---------------------------------------------------------------------------- diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index 63d3a87eed..69d7433e45 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -34,11 +34,7 @@ #include "wx/ioswrap.h" -#if wxUSE_IOSTREAMH - #include -#else - #include -#endif +#include #include "wx/wfstream.h" #include "wx/datstrm.h" diff --git a/setup.h.in b/setup.h.in index b33699b9c9..fad308dc54 100644 --- a/setup.h.in +++ b/setup.h.in @@ -222,9 +222,6 @@ #define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL -#define wxUSE_IOSTREAMH 0 - - #define wxUSE_LONGLONG 0 diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 241fa2cf42..a42517465c 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -63,13 +63,9 @@ #include "wx/except.h" #if wxUSE_STD_IOSTREAM - #include "wx/ioswrap.h" #include "wx/beforestd.h" - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif + #include + #include #include "wx/afterstd.h" #else #include "wx/wfstream.h" diff --git a/src/common/variant.cpp b/src/common/variant.cpp index e30516a1f2..0098b9a90e 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -29,11 +29,7 @@ #endif #if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif + #include #endif #if wxUSE_STREAMS diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 27581dae19..c27e2eaf81 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -34,11 +34,7 @@ #endif #if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif + #include #endif #include "wx/filefn.h" diff --git a/src/osx/iphone/textctrl.mm b/src/osx/iphone/textctrl.mm index c3cfe7d596..190afe6a06 100644 --- a/src/osx/iphone/textctrl.mm +++ b/src/osx/iphone/textctrl.mm @@ -34,11 +34,7 @@ #endif #if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif + #include #endif #include "wx/filefn.h" diff --git a/src/osx/textctrl_osx.cpp b/src/osx/textctrl_osx.cpp index c00e462ae4..8fd8201d26 100644 --- a/src/osx/textctrl_osx.cpp +++ b/src/osx/textctrl_osx.cpp @@ -34,11 +34,7 @@ #endif #if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif + #include #endif #include "wx/filefn.h" diff --git a/src/osx/textentry_osx.cpp b/src/osx/textentry_osx.cpp index 54421bb598..f0b58ab524 100644 --- a/src/osx/textentry_osx.cpp +++ b/src/osx/textentry_osx.cpp @@ -34,11 +34,7 @@ #endif #if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif + #include #endif #include "wx/filefn.h" From 271711b0304b5c3cded00bf0d413eba01f4e9f01 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Oct 2019 20:49:44 +0200 Subject: [PATCH 3/4] Get rid of spurious warning in CRT malloc.h with MSVS 2017 Recent MSVS 2017 versions (15.9.x) as well as MSVS 2019 give warning C4548 about "expression before comma having no effect" when including standard CRT headers. This happens because when building projects targeting 8.1 SDK, as the IDE uses the hard coded 10.0.240.0 version of UCRT headers in this case (see \Common7\IDE\VC\VCTargets\Microsoft.Cpp.Common.props), and the headers in this version haven't been, and will never be, updated to avoid this warning, as was done in later 10.0.x UCRT versions. Fix this by explicitly disabling the warning in wx/beforestd.h, as even setting the warning level to 1 for the standard headers somehow isn't enough to suppress it if it's enabled. --- include/wx/afterstd.h | 5 +++++ include/wx/beforestd.h | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/wx/afterstd.h b/include/wx/afterstd.h index 8cb0fd19ca..5594f6956b 100644 --- a/include/wx/afterstd.h +++ b/include/wx/afterstd.h @@ -16,6 +16,11 @@ #include "wx/msw/winundef.h" #endif +// undo what we did in wx/beforestd.h +#if defined(__VISUALC__) && __VISUALC__ >= 1910 + #pragma warning(pop) +#endif // VC++ >= 14.1 + // see beforestd.h for explanation #if defined(HAVE_VISIBILITY) && defined(HAVE_BROKEN_LIBSTDCXX_VISIBILITY) #pragma GCC visibility pop diff --git a/include/wx/beforestd.h b/include/wx/beforestd.h index c5a95da564..6a2550bcbe 100644 --- a/include/wx/beforestd.h +++ b/include/wx/beforestd.h @@ -19,6 +19,19 @@ it can be included several times. */ +#if defined(__VISUALC__) && __VISUALC__ >= 1910 + #pragma warning(push, 1) + + // This warning, given when a malloc.h from 10.0.240.0 version of UCRT, + // which is used when building projects targeting 8.1 SDK, compiled by MSVS + // 2017 or later, is still given even at warning level 1, in spite of it + // being level 4, so we have to explicitly disable it here (as we do it + // after the warning push pragma, it will be restored after pop). + // + // expression before comma has no effect; expected expression with side-effect + #pragma warning(disable:4548) +#endif // VC++ >= 14.1 + /** GCC's visibility support is broken for libstdc++ in some older versions (namely Debian/Ubuntu's GCC 4.1, see From e34823a0c4d3421d5b2c32fa50e13f543907f20b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 22 Oct 2019 02:42:33 +0200 Subject: [PATCH 4/4] Stop using wx/ioswrap.h in the samples This is not necessary any longer after wxUSE_IOSTREAMH removal and it makes the sample code more clear. --- samples/docview/doc.cpp | 2 +- samples/typetest/typetest.cpp | 3 +-- samples/widgets/textctrl.cpp | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/samples/docview/doc.cpp b/samples/docview/doc.cpp index 50ab0ba337..2ce98172f1 100644 --- a/samples/docview/doc.cpp +++ b/samples/docview/doc.cpp @@ -29,7 +29,7 @@ #endif #if wxUSE_STD_IOSTREAM - #include "wx/ioswrap.h" + #include #else #include "wx/txtstrm.h" #endif diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index 69d7433e45..891a23b568 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -32,8 +32,7 @@ #undef new #endif -#include "wx/ioswrap.h" - +#include #include #include "wx/wfstream.h" diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index ff6ea02226..e908c636a3 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -40,7 +40,6 @@ #endif #include "wx/sizer.h" -#include "wx/ioswrap.h" #include "widgets.h"