diff --git a/include/boost/locale/boundary/boundary_point.hpp b/include/boost/locale/boundary/boundary_point.hpp index 370dd5f..0743347 100644 --- a/include/boost/locale/boundary/boundary_point.hpp +++ b/include/boost/locale/boundary/boundary_point.hpp @@ -100,7 +100,7 @@ namespace boost { namespace locale { namespace boundary { typedef boundary_point sboundary_point; ///< convenience typedef typedef boundary_point wsboundary_point; ///< convenience typedef -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t typedef boundary_point u8sboundary_point; ///< convenience typedef #endif #ifdef BOOST_LOCALE_ENABLE_CHAR16_T diff --git a/include/boost/locale/boundary/index.hpp b/include/boost/locale/boundary/index.hpp index 92b7613..249ef87 100644 --- a/include/boost/locale/boundary/index.hpp +++ b/include/boost/locale/boundary/index.hpp @@ -868,7 +868,7 @@ namespace boost { namespace locale { namespace boundary { typedef segment_index ssegment_index; ///< convenience typedef typedef segment_index wssegment_index; ///< convenience typedef -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t typedef segment_index u8ssegment_index; ///< convenience typedef #endif #ifdef BOOST_LOCALE_ENABLE_CHAR16_T @@ -892,7 +892,7 @@ namespace boost { namespace locale { namespace boundary { typedef boundary_point_index sboundary_point_index; ///< convenience typedef typedef boundary_point_index wsboundary_point_index; ///< convenience typedef -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t typedef boundary_point_index u8sboundary_point_index; ///< convenience typedef #endif #ifdef BOOST_LOCALE_ENABLE_CHAR16_T diff --git a/include/boost/locale/boundary/segment.hpp b/include/boost/locale/boundary/segment.hpp index 24e129d..84243ab 100644 --- a/include/boost/locale/boundary/segment.hpp +++ b/include/boost/locale/boundary/segment.hpp @@ -340,7 +340,7 @@ namespace boost { namespace locale { namespace boundary { typedef segment ssegment; ///< convenience typedef typedef segment wssegment; ///< convenience typedef -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t typedef segment u8ssegment; ///< convenience typedef #endif #ifdef BOOST_LOCALE_ENABLE_CHAR16_T diff --git a/include/boost/locale/config.hpp b/include/boost/locale/config.hpp index 1c69c92..2064810 100644 --- a/include/boost/locale/config.hpp +++ b/include/boost/locale/config.hpp @@ -89,11 +89,6 @@ # define BOOST_LOCALE_NO_SANITIZE(what) #endif -#if !defined(__cpp_lib_char8_t) || BOOST_WORKAROUND(BOOST_CLANG_VERSION, < 150000) -// No std::basic_string or bug in Clang: https://github.com/llvm/llvm-project/issues/55560 -# define BOOST_LOCALE_NO_CXX20_STRING8 -#endif - /// \endcond #endif // boost/locale/config.hpp diff --git a/include/boost/locale/format.hpp b/include/boost/locale/format.hpp index 58a9a0f..68020a4 100644 --- a/include/boost/locale/format.hpp +++ b/include/boost/locale/format.hpp @@ -418,7 +418,7 @@ namespace boost { namespace locale { typedef basic_format format; /// Definition of wchar_t based format typedef basic_format wformat; -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t /// Definition of char8_t based format typedef basic_format u8format; #endif diff --git a/include/boost/locale/message.hpp b/include/boost/locale/message.hpp index 88a4aef..fafff38 100644 --- a/include/boost/locale/message.hpp +++ b/include/boost/locale/message.hpp @@ -341,7 +341,7 @@ namespace boost { namespace locale { typedef basic_message message; /// Convenience typedef for wchar_t typedef basic_message wmessage; -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t /// Convenience typedef for char8_t typedef basic_message u8message; #endif diff --git a/src/encoding/codepage.cpp b/src/encoding/codepage.cpp index 0f052b8..814a803 100644 --- a/src/encoding/codepage.cpp +++ b/src/encoding/codepage.cpp @@ -224,7 +224,7 @@ namespace boost { namespace locale { namespace conv { BOOST_LOCALE_INSTANTIATE(char); BOOST_LOCALE_INSTANTIATE_NO_CHAR(wchar_t); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t BOOST_LOCALE_INSTANTIATE_NO_CHAR(char8_t); #endif diff --git a/src/icu/conversion.cpp b/src/icu/conversion.cpp index 130a0d4..a7fddb4 100644 --- a/src/icu/conversion.cpp +++ b/src/icu/conversion.cpp @@ -198,7 +198,7 @@ namespace boost { namespace locale { namespace impl_icu { return std::locale(in, new utf8_converter_impl(cd)); return std::locale(in, new converter_impl(cd)); case char_facet_t::wchar_f: return std::locale(in, new converter_impl(cd)); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t case char_facet_t::char8_f: return std::locale(in, new utf8_converter_impl(cd)); #elif defined(__cpp_char8_t) case char_facet_t::char8_f: break; diff --git a/src/posix/converter.cpp b/src/posix/converter.cpp index 38a4bb6..13477aa 100644 --- a/src/posix/converter.cpp +++ b/src/posix/converter.cpp @@ -125,7 +125,7 @@ namespace boost { namespace locale { namespace impl_posix { return std::locale(in, new std_converter(std::move(lc))); } case char_facet_t::wchar_f: return std::locale(in, new std_converter(std::move(lc))); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t case char_facet_t::char8_f: return std::locale(in, new utf8_converter(std::move(lc))); #elif defined(__cpp_char8_t) case char_facet_t::char8_f: break; diff --git a/src/shared/message.cpp b/src/shared/message.cpp index 88cee09..70eafd2 100644 --- a/src/shared/message.cpp +++ b/src/shared/message.cpp @@ -620,7 +620,7 @@ namespace boost { namespace locale { namespace detail { case char_facet_t::nochar: break; case char_facet_t::char_f: return std::locale(in, gnu_gettext::create_messages_facet(minf)); case char_facet_t::wchar_f: return std::locale(in, gnu_gettext::create_messages_facet(minf)); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t case char_facet_t::char8_f: return std::locale(in, gnu_gettext::create_messages_facet(minf)); #elif defined(__cpp_char8_t) case char_facet_t::char8_f: break; diff --git a/src/std/converter.cpp b/src/std/converter.cpp index fcfb7df..ec60a58 100644 --- a/src/std/converter.cpp +++ b/src/std/converter.cpp @@ -104,7 +104,7 @@ namespace boost { namespace locale { namespace impl_std { else return std::locale(in, new std_converter(locale_name)); case char_facet_t::wchar_f: return std::locale(in, new std_converter(locale_name)); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t case char_facet_t::char8_f: return std::locale(in, new utf8_converter(locale_name)); #elif defined(__cpp_char8_t) case char_facet_t::char8_f: break; diff --git a/src/util/foreach_char.hpp b/src/util/foreach_char.hpp index 37328e1..1c0dc35 100644 --- a/src/util/foreach_char.hpp +++ b/src/util/foreach_char.hpp @@ -9,7 +9,7 @@ #include -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t # define BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F) F(char8_t) # define BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F) F(char8_t) #elif defined(__cpp_char8_t) diff --git a/src/win32/converter.cpp b/src/win32/converter.cpp index 455fef6..fe168df 100644 --- a/src/win32/converter.cpp +++ b/src/win32/converter.cpp @@ -62,7 +62,7 @@ namespace boost { namespace locale { namespace impl_win { case char_facet_t::nochar: break; case char_facet_t::char_f: return std::locale(in, new utf8_converter(lc)); case char_facet_t::wchar_f: return std::locale(in, new wide_converter(lc)); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t case char_facet_t::char8_f: return std::locale(in, new utf8_converter(lc)); #elif defined(__cpp_char8_t) case char_facet_t::char8_f: break; diff --git a/test/boostLocale/test/tools.hpp b/test/boostLocale/test/tools.hpp index 7e9a045..6537aa5 100644 --- a/test/boostLocale/test/tools.hpp +++ b/test/boostLocale/test/tools.hpp @@ -113,7 +113,7 @@ std::basic_string to(const std::string& utf8) return out; } -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t template<> std::basic_string to(const std::string& utf8) { diff --git a/test/show_config.cpp b/test/show_config.cpp index 226ec1c..e2dd854 100644 --- a/test/show_config.cpp +++ b/test/show_config.cpp @@ -65,7 +65,7 @@ void test_main(int /*argc*/, char** /*argv*/) std::cout << "no\n"; #endif std::cout << "- std::basic_string: "; -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << "yes\n"; #elif defined(__cpp_lib_char8_t) std::cout << "partial\n"; diff --git a/test/test_boundary.cpp b/test/test_boundary.cpp index 7a2715a..64b1b76 100644 --- a/test/test_boundary.cpp +++ b/test/test_boundary.cpp @@ -310,7 +310,7 @@ void test_boundaries(std::string* all, int* first, int* second, lb::boundary_typ run_word(all, first, second, nullptr, nullptr, nullptr, g("he_IL.cp1255"), t); std::cout << " wchar_t" << std::endl; run_word(all, first, second, nullptr, nullptr, nullptr, g("he_IL.UTF-8"), t); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << " char8_t" << std::endl; run_word(all, first, second, nullptr, nullptr, nullptr, g("he_IL.UTF-8"), t); #endif @@ -373,7 +373,7 @@ void word_boundary() run_word(txt_simple, none_simple, zero, word_simple, zero, zero, utf8_en_locale); run_word(txt_all, none_all, num_all, word_all, kana_all, ideo_all, utf8_jp_locale); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << " char8_t" << std::endl; run_word(txt_empty, zero, zero, zero, zero, zero, g("ja_JP.UTF-8")); run_word(txt_simple, none_simple, zero, word_simple, zero, zero, utf8_en_locale); diff --git a/test/test_convert.cpp b/test/test_convert.cpp index 8752d74..d00568f 100644 --- a/test/test_convert.cpp +++ b/test/test_convert.cpp @@ -25,7 +25,7 @@ void test_norm(std::string orig, std::string normal, boost::locale::norm_type ty { test_normc(orig, normal, type); test_normc(to(orig), to(normal), type); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t test_normc(to(orig), to(normal), type); #endif #ifdef BOOST_LOCALE_ENABLE_CHAR16_T @@ -105,7 +105,7 @@ void test_main(int /*argc*/, char** /*argv*/) TEST_ALL_CASES; #undef TEST_V -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t # define TEST_V(how, source_s, dest_s) TEST_A(char8_t, how, to(source_s), to(dest_s)) TEST_ALL_CASES; # undef TEST_V diff --git a/test/test_encoding.cpp b/test/test_encoding.cpp index 0a01d43..6f1dcc6 100644 --- a/test/test_encoding.cpp +++ b/test/test_encoding.cpp @@ -425,7 +425,7 @@ void test_utf_to_utf_for() test_from_utf_for_impls(utf(utf8_string), utf8_string, "UTF-8"); std::cout << "---- wchar_t\n"; test_utf_to_utf_for(utf8_string); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << "---- char8_t\n"; test_utf_to_utf_for(utf8_string); #endif @@ -446,7 +446,7 @@ void test_utf_to_utf() test_utf_to_utf_for(); std::cout << "-- wchar_t\n"; test_utf_to_utf_for(); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << "-- char8_t\n"; test_utf_to_utf_for(); #endif @@ -643,7 +643,7 @@ void test_latin1_conversions() test_latin1_conversions_for(); std::cout << "-- wchar_t\n"; test_latin1_conversions_for(); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << "-- char8_t\n"; test_latin1_conversions_for(); #endif @@ -781,7 +781,7 @@ void test_main(int /*argc*/, char** /*argv*/) test_utf_for(); std::cout << " wchar_t" << std::endl; test_utf_for(); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << " char8_t" << std::endl; test_utf_for(); #endif diff --git a/test/test_generator.cpp b/test/test_generator.cpp index ed3ac3c..88bfb87 100644 --- a/test/test_generator.cpp +++ b/test/test_generator.cpp @@ -329,7 +329,7 @@ void test_main(int /*argc*/, char** /*argv*/) #else # define TEST_FOR_CHAR8(check) (void)0 #endif -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t # define TEST_FOR_STRING8(check) TEST(check) #else # define TEST_FOR_STRING8(check) (void)0 diff --git a/test/test_ios_info.cpp b/test/test_ios_info.cpp index 79179a8..bcffe3d 100644 --- a/test/test_ios_info.cpp +++ b/test/test_ios_info.cpp @@ -222,7 +222,7 @@ void test_any_string() TEST_EQ(s.get(), ascii_to("Char32 Pattern")); TEST_THROWS(s.get(), std::bad_cast); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t s.set(ascii_to("Char8 Pattern")); TEST_EQ(s.get(), ascii_to("Char8 Pattern")); TEST_THROWS(s.get(), std::bad_cast); diff --git a/test/test_message.cpp b/test/test_message.cpp index 304d66c..80ea7d7 100644 --- a/test/test_message.cpp +++ b/test/test_message.cpp @@ -84,7 +84,7 @@ std::wstring same_w(std::wstring s) return s; } -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::basic_string same_u8(std::basic_string s) { return s; @@ -376,7 +376,7 @@ void test_cntranslate(const std::string& c, impl::test_cntranslate(c, s, p, n, expected, l, domain); std::cout << " wchar_t" << std::endl; impl::test_cntranslate(c, s, p, n, expected, l, domain); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << " char8_t" << std::endl; impl::test_cntranslate(c, s, p, n, expected, l, domain); #endif @@ -401,7 +401,7 @@ void test_ntranslate(const std::string& s, impl::test_ntranslate(s, p, n, expected, l, domain); std::cout << " wchar_t" << std::endl; impl::test_ntranslate(s, p, n, expected, l, domain); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << " char8_t" << std::endl; impl::test_ntranslate(s, p, n, expected, l, domain); #endif @@ -425,7 +425,7 @@ void test_ctranslate(const std::string& c, impl::test_ctranslate(c, original, expected, l, domain); std::cout << " wchar_t" << std::endl; impl::test_ctranslate(c, original, expected, l, domain); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << " char8_t" << std::endl; impl::test_ctranslate(c, original, expected, l, domain); #endif @@ -448,7 +448,7 @@ void test_translate(const std::string& original, impl::test_translate(original, expected, l, domain); std::cout << " wchar_t" << std::endl; impl::test_translate(original, expected, l, domain); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << " char8_t" << std::endl; impl::test_translate(original, expected, l, domain); #endif @@ -570,7 +570,7 @@ void test_main(int argc, char** argv) TEST_EQ(same_s(bl::translate("hello")), "שלום"); TEST_EQ(same_w(bl::translate(to("hello"))), to("שלום")); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t TEST_EQ(same_u8(bl::translate(to("hello"))), to("שלום")); #endif #ifdef BOOST_LOCALE_ENABLE_CHAR16_T diff --git a/test/test_std_convert.cpp b/test/test_std_convert.cpp index bc8126e..1b8537a 100644 --- a/test/test_std_convert.cpp +++ b/test/test_std_convert.cpp @@ -84,7 +84,7 @@ void test_main(int /*argc*/, char** /*argv*/) test_char(); std::cout << "Testing wchar_t" << std::endl; test_char(); -#ifndef BOOST_LOCALE_NO_CXX20_STRING8 +#ifdef __cpp_lib_char8_t std::cout << "Testing char8_t" << std::endl; test_char(); #endif