summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-24 09:15:24 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2022-01-24 20:11:23 +0000
commitdf0f8e036cdef59d596113c4acb450258aba11d3 (patch)
tree0d03f6ddd9ab90c9a0bb8cbcafd58265df211783
parenta8f00bf0ad864afc25986c0132d3397d785eb9fe (diff)
Replace cxx17_bm_searcher config check with feature test macro
This enables the code also for boostrap. Amends b24e689cb561d81745ff47a5ce4595b809923914. Pick-to: 6.3 Change-Id: I8efc76c20690282a2428f360d6b93896966b97ee Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/corelib/configure.cmake26
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h1
-rw-r--r--src/corelib/text/qstring.cpp2
3 files changed, 1 insertions, 28 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index 71e237ae9c..107028bfac 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -156,28 +156,6 @@ std::mt19937 mt(0);
}
")
-# cxx17_bm_searcher
-qt_config_compile_test(cxx17_bm_searcher
- LABEL "C++17 boyer_moore_searcher"
- CODE
-"#include <algorithm>
-#include <functional>
-
-int main(void)
-{
- /* BEGIN TEST: */
-const char haystack[] = \"hello\";
-const char needle[] = \"e\";
-const auto it =
-std::search(haystack + 0, haystack + std::size(haystack),
-std::boyer_moore_searcher(needle + 0, needle + std::size(needle)));
-(void)it;
- /* END TEST: */
- return 0;
-}
-"# FIXME: qmake: CONFIG += c++17
-)
-
# cxx17_filesystem
qt_config_compile_test(cxx17_filesystem
LABEL "C++17 <filesystem>"
@@ -541,10 +519,6 @@ qt_feature("cxx11_future" PUBLIC
LABEL "C++11 <future>"
CONDITION TEST_cxx11_future
)
-qt_feature("cxx17_bm_searcher" PRIVATE
- LABEL "C++17 boyer_moore_searcher"
- CONDITION TEST_cxx17_bm_searcher
-)
qt_feature("cxx17_filesystem" PUBLIC
LABEL "C++17 <filesystem>"
CONDITION TEST_cxx17_filesystem
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 090dde8312..f8858460ca 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -78,7 +78,6 @@
#define QT_FEATURE_cborstreamwriter 1
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_FEATURE_cxx11_random (__has_include(<random>) ? 1 : -1)
-#define QT_FEATURE_cxx17_bm_searcher -1
#define QT_FEATURE_cxx17_filesystem -1
#define QT_NO_DATASTREAM
#define QT_FEATURE_datestring 1
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index a8482c5fbd..437b31089d 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -10564,7 +10564,7 @@ qsizetype QtPrivate::findString(QLatin1String haystack, qsizetype from, QLatin1S
return -1;
}
-#if QT_CONFIG(cxx17_bm_searcher)
+#ifdef __cpp_lib_boyer_moore_searcher
const auto ciHasher = [](char a) { return latin1Lower[uchar(a)]; };
const auto ciEqual = [](char a, char b) {
return latin1Lower[uchar(a)] == latin1Lower[uchar(b)];