diff --git a/doc/Jamfile b/doc/Jamfile index 7a8cab2f..3108ac81 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -44,7 +44,6 @@ docca.pyreference reference.qbk STRIP_FROM_PATH=$(include-prefix) "PREDEFINED=\\ BOOST_MYSQL_DOXYGEN \\ - __cpp_lib_string_view \\ __cpp_char8_t \\ \"BOOST_PFR_ENABLED=1\" \\ \"BOOST_PFR_CORE_NAME_ENABLED=1\" \\ diff --git a/include/boost/mysql/field.hpp b/include/boost/mysql/field.hpp index 0d7d04b7..acad94e2 100644 --- a/include/boost/mysql/field.hpp +++ b/include/boost/mysql/field.hpp @@ -16,12 +16,13 @@ #include #include +#include #include #include #include #include -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW #include #endif @@ -187,7 +188,7 @@ public: /// \copydoc field(const std::string&) explicit field(string_view v) : repr_(boost::variant2::in_place_type_t(), v) {} -#if defined(__cpp_lib_string_view) +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW /// \copydoc field(const std::string&) explicit field(std::string_view v) : repr_(boost::variant2::in_place_type_t(), v) {} #endif @@ -412,7 +413,7 @@ public: return *this; } -#if defined(__cpp_lib_string_view) +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW /// \copydoc operator=(const std::string&) field& operator=(std::string_view v) { diff --git a/test/integration/test/snippets/sql_formatting.cpp b/test/integration/test/snippets/sql_formatting.cpp index 105760f3..e0a585dd 100644 --- a/test/integration/test/snippets/sql_formatting.cpp +++ b/test/integration/test/snippets/sql_formatting.cpp @@ -35,7 +35,7 @@ #ifndef BOOST_NO_CXX17_HDR_OPTIONAL #include #endif -#ifdef __cpp_lib_polymorphic_allocator +#ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE #include #endif #ifdef BOOST_MYSQL_HAS_RANGES @@ -717,7 +717,7 @@ BOOST_AUTO_TEST_CASE(section_sql_formatting) // res.value() would throw an error, like format_sql would //] } -#ifdef __cpp_lib_polymorphic_allocator +#ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE { //[sql_formatting_custom_string // Create a format context that uses std::pmr::string diff --git a/test/unit/test/constant_string_view.cpp b/test/unit/test/constant_string_view.cpp index 940b1cda..1e11593b 100644 --- a/test/unit/test/constant_string_view.cpp +++ b/test/unit/test/constant_string_view.cpp @@ -12,7 +12,7 @@ #include -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW #include #endif @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(ctor_string_view) } #endif -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_AUTO_TEST_CASE(ctor_std_string_view) { constexpr std::string_view s = "abcd"; @@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(runtime_string) BOOST_TEST(f(runtime(s)) == "abc"); } -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_AUTO_TEST_CASE(runtime_std_string_view) { std::string_view s = "abc"; diff --git a/test/unit/test/detail/writable_field_traits.cpp b/test/unit/test/detail/writable_field_traits.cpp index dd2a266f..3b60fc88 100644 --- a/test/unit/test/detail/writable_field_traits.cpp +++ b/test/unit/test/detail/writable_field_traits.cpp @@ -131,7 +131,7 @@ static_assert(is_writable_field::value, ""); static_assert(is_writable_field::value, ""); static_assert(is_writable_field::value, ""); static_assert(is_writable_field::value, ""); -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW static_assert(is_writable_field::value, ""); #endif static_assert(!is_writable_field::value, ""); @@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE(to_field_) BOOST_TEST(to_field(s) == field_view("ljk")); BOOST_TEST(to_field(static_cast(s)) == field_view("ljk")); BOOST_TEST(to_field(string_view("abc")) == field_view("abc")); -#if defined(__cpp_lib_string_view) +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_TEST(to_field(std::string_view("abc")) == field_view("abc")); #endif BOOST_TEST(to_field(static_cast("abc")) == field_view("abc")); diff --git a/test/unit/test/field.cpp b/test/unit/test/field.cpp index 12736b32..5a44a90c 100644 --- a/test/unit/test/field.cpp +++ b/test/unit/test/field.cpp @@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(from_boost_string_view) BOOST_TEST(v.as_string() == "test"); } -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_AUTO_TEST_CASE(from_std_string_view) { std::string_view sv("test123", 4); @@ -433,7 +433,7 @@ BOOST_AUTO_TEST_CASE(from_boost_string_view) BOOST_TEST(v.as_string() == "test"); } -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_AUTO_TEST_CASE(from_std_string_view) { std::string_view sv("test123", 4); diff --git a/test/unit/test/format_sql/formattable.cpp b/test/unit/test/format_sql/formattable.cpp index ac21f9f0..2315225c 100644 --- a/test/unit/test/format_sql/formattable.cpp +++ b/test/unit/test/format_sql/formattable.cpp @@ -25,10 +25,10 @@ #include "format_common.hpp" #include "test_common/has_ranges.hpp" -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW #include #endif -#ifdef __cpp_lib_optional +#ifndef BOOST_NO_CXX17_HDR_OPTIONAL #include #endif #ifdef BOOST_MYSQL_HAS_RANGES @@ -94,7 +94,7 @@ BOOST_MYSQL_CHECK_FORMATTABLE(const char, false) BOOST_MYSQL_CHECK_FORMATTABLE(std::string, true) BOOST_MYSQL_CHECK_FORMATTABLE(string_with_alloc, true) BOOST_MYSQL_CHECK_FORMATTABLE(string_view, true) -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_MYSQL_CHECK_FORMATTABLE(std::string_view, true) #endif BOOST_MYSQL_CHECK_FORMATTABLE(const char*, true) diff --git a/test/unit/test/format_sql/individual_value.cpp b/test/unit/test/format_sql/individual_value.cpp index 9a54b958..162a9bce 100644 --- a/test/unit/test/format_sql/individual_value.cpp +++ b/test/unit/test/format_sql/individual_value.cpp @@ -29,10 +29,10 @@ #include "test_common/create_basic.hpp" #include "test_common/printing.hpp" -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW #include #endif -#ifdef __cpp_lib_optional +#ifndef BOOST_NO_CXX17_HDR_OPTIONAL #include #endif @@ -278,7 +278,7 @@ BOOST_AUTO_TEST_CASE(string_view_) BOOST_TEST(format_sql(opts, identifier_fmt, string_view("abc")) == "SELECT `abc` FROM myt"); } -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_AUTO_TEST_CASE(std_string_view) { BOOST_TEST(format_sql(opts, single_fmt, std::string_view("abc")) == "SELECT 'abc';"); @@ -486,7 +486,7 @@ BOOST_AUTO_TEST_CASE(boost_optional) BOOST_TEST(format_sql(opts, single_fmt, co_clval) == "SELECT 'abdef';"); } -#ifdef __cpp_lib_optional +#ifndef BOOST_NO_CXX17_HDR_OPTIONAL BOOST_AUTO_TEST_CASE(std_optional) { std::optional o_lval("abc"); @@ -681,7 +681,7 @@ void optional_error_test() BOOST_AUTO_TEST_CASE(boost_optional_error) { optional_error_test(); } -#ifdef __cpp_lib_optional +#ifndef BOOST_NO_CXX17_HDR_OPTIONAL BOOST_AUTO_TEST_CASE(std_optional_error) { optional_error_test(); } #endif diff --git a/test/unit/test/format_sql/ranges.cpp b/test/unit/test/format_sql/ranges.cpp index 40b7fcbe..bcc0105c 100644 --- a/test/unit/test/format_sql/ranges.cpp +++ b/test/unit/test/format_sql/ranges.cpp @@ -25,10 +25,10 @@ #include "test_common/has_ranges.hpp" #include "test_common/printing.hpp" -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW #include #endif -#ifdef __cpp_lib_optional +#ifndef BOOST_NO_CXX17_HDR_OPTIONAL #include #endif #ifdef BOOST_MYSQL_HAS_RANGES @@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(elm_string) BOOST_TEST( format_sql(opts, single_fmt, std::vector{"abc", "buf"}) == "SELECT 'abc', 'buf';" ); -#ifdef __cpp_lib_string_view +#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW BOOST_TEST( format_sql(opts, single_fmt, std::vector{"abc", "buf"}) == "SELECT 'abc', 'buf';" ); @@ -159,7 +159,7 @@ BOOST_AUTO_TEST_CASE(elm_boost_optional) BOOST_TEST(format_sql(opts, single_fmt, optionals) == "SELECT 42, 10, NULL;"); } -#ifdef __cpp_lib_optional +#ifndef BOOST_NO_CXX17_HDR_OPTIONAL BOOST_AUTO_TEST_CASE(elm_std_optional) { std::vector> optionals{"abc", {}, "d"};