From a0ae0cd316ef97c216110a9019733f8c859dc8e0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Oct 2022 00:13:15 +0200 Subject: [PATCH] Use unconditionally Don't use or even mention tr1/type_traits any more. --- build/cmake/setup.cmake | 4 ---- build/cmake/setup.h.in | 10 ---------- configure | 2 -- configure.in | 1 - include/wx/defs.h | 3 --- include/wx/osx/config_xcode.h | 1 - include/wx/strvararg.h | 35 +---------------------------------- setup.h.in | 10 ---------- setup.h_vms | 10 ---------- tests/strings/vararg.cpp | 9 --------- 10 files changed, 1 insertion(+), 84 deletions(-) diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index 55be786245..2386a2eefe 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -579,10 +579,6 @@ endif() check_cxx_symbol_exists(round math.h HAVE_ROUND) # Check includes -if(NOT MSVC_VERSION LESS 1600) - check_include_file_cxx(tr1/type_traits HAVE_TR1_TYPE_TRAITS) - check_include_file_cxx(type_traits HAVE_TYPE_TRAITS) -endif() check_include_file(fcntl.h HAVE_FCNTL_H) check_include_file(langinfo.h HAVE_LANGINFO_H) check_include_file(sched.h HAVE_SCHED_H) diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 89e803761b..89ab30f698 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -778,16 +778,6 @@ */ #cmakedefine HAVE_TR1_UNORDERED_SET 1 -/* - * Define if your compiler has - */ -#cmakedefine HAVE_TR1_TYPE_TRAITS 1 - -/* - * Define if your compiler has - */ -#cmakedefine HAVE_TYPE_TRAITS 1 - /* * Define if the compiler supports simple visibility declarations. */ diff --git a/configure b/configure index 9a7a50cf5f..88b1210706 100755 --- a/configure +++ b/configure @@ -24732,8 +24732,6 @@ $as_echo "#define HAVE_STD_UNORDERED_MAP 1" >>confdefs.h $as_echo "#define HAVE_STD_UNORDERED_SET 1" >>confdefs.h -$as_echo "#define HAVE_TYPE_TRAITS 1" >>confdefs.h - diff --git a/configure.in b/configure.in index 7638fd97ae..d464779f8b 100644 --- a/configure.in +++ b/configure.in @@ -1882,7 +1882,6 @@ fi AC_DEFINE(HAVE_STD_UNORDERED_MAP) AC_DEFINE(HAVE_STD_UNORDERED_SET) -AC_DEFINE(HAVE_TYPE_TRAITS) dnl check for atomic operations builtins for wx/atomic.h: WX_ATOMIC_BUILTINS diff --git a/include/wx/defs.h b/include/wx/defs.h index 9f324f90bd..568989ffb9 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -315,9 +315,6 @@ typedef short int WXTYPE; /* for consistency with wxStatic/DynamicCast defined in wx/object.h */ #define wxConstCast(obj, className) const_cast(obj) -#ifndef HAVE_TYPE_TRAITS - #define HAVE_TYPE_TRAITS -#endif #ifndef HAVE_STD_UNORDERED_MAP #define HAVE_STD_UNORDERED_MAP #endif diff --git a/include/wx/osx/config_xcode.h b/include/wx/osx/config_xcode.h index 0d905b21a5..5692f5cada 100644 --- a/include/wx/osx/config_xcode.h +++ b/include/wx/osx/config_xcode.h @@ -26,7 +26,6 @@ #if !defined(__has_include) #define HAVE_TR1_UNORDERED_MAP 1 #define HAVE_TR1_UNORDERED_SET 1 - #define HAVE_TR1_TYPE_TRAITS 1 #endif #define HAVE_GCC_ATOMIC_BUILTINS 1 #endif diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index 935d0a05f9..8529e26c9c 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -18,15 +18,7 @@ #include "wx/buffer.h" #include "wx/unichar.h" -#if defined(HAVE_TYPE_TRAITS) - #include -#elif defined(HAVE_TR1_TYPE_TRAITS) - #ifdef __VISUALC__ - #include - #else - #include - #endif -#endif +#include class WXDLLIMPEXP_FWD_BASE wxCStrData; class WXDLLIMPEXP_FWD_BASE wxString; @@ -342,8 +334,6 @@ struct wxFormatStringArgumentFinder #endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL -#if defined(HAVE_TYPE_TRAITS) || defined(HAVE_TR1_TYPE_TRAITS) - // Note: this type is misnamed, so that the error message is easier to // understand (no error happens for enums, because the IsEnum=true case is // specialized). @@ -359,33 +349,10 @@ struct wxFormatStringSpecifierNonPodType template struct wxFormatStringSpecifier { -#ifdef HAVE_TYPE_TRAITS typedef std::is_enum is_enum; -#elif defined HAVE_TR1_TYPE_TRAITS - typedef std::tr1::is_enum is_enum; -#endif enum { value = wxFormatStringSpecifierNonPodType::value }; }; -#else // !HAVE_(TR1_)TYPE_TRAITS - -template -struct wxFormatStringSpecifier -{ - // We can't detect enums without is_enum, so the only thing we can - // do is to accept unknown types. However, the only acceptable unknown - // types still are enums, which are promoted to ints, so return Arg_Int - // here. This will at least catch passing of non-POD types through ... at - // runtime. - // - // Furthermore, if the compiler doesn't have partial template - // specialization, we didn't cover pointers either. - enum { value = wxFormatString::Arg_Int }; -}; - -#endif // HAVE_TR1_TYPE_TRAITS/!HAVE_TR1_TYPE_TRAITS - - template struct wxFormatStringSpecifier { diff --git a/setup.h.in b/setup.h.in index 34cdeebbce..d6094b4a27 100644 --- a/setup.h.in +++ b/setup.h.in @@ -778,16 +778,6 @@ */ #undef HAVE_TR1_UNORDERED_SET -/* - * Define if your compiler has - */ -#undef HAVE_TR1_TYPE_TRAITS - -/* - * Define if your compiler has - */ -#undef HAVE_TYPE_TRAITS - /* * Define if the compiler supports simple visibility declarations. */ diff --git a/setup.h_vms b/setup.h_vms index e9d962829b..3ff59d6fcf 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -844,16 +844,6 @@ typedef pid_t GPid; */ #undef HAVE_TR1_UNORDERED_SET -/* - * Define if your compiler has - */ -#undef HAVE_TR1_TYPE_TRAITS - -/* - * Define if your compiler has - */ -#undef HAVE_TYPE_TRAITS - /* * Define if the compiler supports simple visibility declarations. */ diff --git a/tests/strings/vararg.cpp b/tests/strings/vararg.cpp index b29395678a..3dfbccfbd9 100644 --- a/tests/strings/vararg.cpp +++ b/tests/strings/vararg.cpp @@ -243,15 +243,6 @@ TEST_CASE("ArgsValidation", "[wxString][vararg][error]") WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("foo%n", ptr) ); WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("foo%i%n", 42, &swritten) ); - // the following test (correctly) fails at compile-time with -#if !defined(HAVE_TYPE_TRAITS) && !defined(HAVE_TR1_TYPE_TRAITS) - wxObject obj; - WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%s", obj) ); - - wxObject& ref = obj; - WX_ASSERT_FAILS_WITH_ASSERT( wxString::Format("%s", ref) ); -#endif - // %c should accept integers too wxString::Format("%c", 80); wxString::Format("%c", wxChar(80) + wxChar(1));