From a710e8bd89663b207e9dfd7392d7037a80490bdc Mon Sep 17 00:00:00 2001 From: MeanSquaredError <35379301+MeanSquaredError@users.noreply.github.com> Date: Tue, 3 Sep 2024 12:04:43 +0300 Subject: [PATCH] Rename macro CXX_STD_VER -> SQLPP_CXX_STD --- include/sqlpp11/compat/cxx_std_ver.h | 7 ------- include/sqlpp11/compat/make_unique.h | 4 ++-- include/sqlpp11/compat/sqlpp_cxx_std.h | 7 +++++++ include/sqlpp11/data_types/text/operand.h | 6 +++--- include/sqlpp11/data_types/text/parameter_value.h | 6 +++--- include/sqlpp11/data_types/text/wrap_operand.h | 6 +++--- include/sqlpp11/result.h | 4 ++-- tests/core/serialize/Insert.cpp | 4 ++-- tests/core/serialize/Where.cpp | 4 ++-- tests/core/usage/Insert.cpp | 6 +++--- 10 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 include/sqlpp11/compat/cxx_std_ver.h create mode 100644 include/sqlpp11/compat/sqlpp_cxx_std.h diff --git a/include/sqlpp11/compat/cxx_std_ver.h b/include/sqlpp11/compat/cxx_std_ver.h deleted file mode 100644 index 92328daf..00000000 --- a/include/sqlpp11/compat/cxx_std_ver.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#ifdef _MSVC_LANG -#define CXX_STD_VER _MSVC_LANG -#else -#define CXX_STD_VER __cplusplus -#endif diff --git a/include/sqlpp11/compat/make_unique.h b/include/sqlpp11/compat/make_unique.h index 57fbbbb9..99d41e12 100644 --- a/include/sqlpp11/compat/make_unique.h +++ b/include/sqlpp11/compat/make_unique.h @@ -26,7 +26,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include @@ -37,7 +37,7 @@ namespace sqlpp template std::unique_ptr make_unique(Args&&... args) { -#if CXX_STD_VER >= 201402L +#if SQLPP_CXX_STD >= 201402L return std::make_unique(std::forward(args)...); #else return std::unique_ptr(new T(std::forward(args)...)); diff --git a/include/sqlpp11/compat/sqlpp_cxx_std.h b/include/sqlpp11/compat/sqlpp_cxx_std.h new file mode 100644 index 00000000..5d5dd261 --- /dev/null +++ b/include/sqlpp11/compat/sqlpp_cxx_std.h @@ -0,0 +1,7 @@ +#pragma once + +#ifdef _MSVC_LANG +#define SQLPP_CXX_STD _MSVC_LANG +#else +#define SQLPP_CXX_STD __cplusplus +#endif diff --git a/include/sqlpp11/data_types/text/operand.h b/include/sqlpp11/data_types/text/operand.h index 67b228fb..6ee9f627 100644 --- a/include/sqlpp11/data_types/text/operand.h +++ b/include/sqlpp11/data_types/text/operand.h @@ -26,11 +26,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L #include #endif #include @@ -53,7 +53,7 @@ namespace sqlpp text_operand(_value_t t) : _t(std::move(t)) { } -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L // allow construction from an std::string_view text_operand(std::string_view t) : _t(t) { diff --git a/include/sqlpp11/data_types/text/parameter_value.h b/include/sqlpp11/data_types/text/parameter_value.h index 19042af7..dbe7b699 100644 --- a/include/sqlpp11/data_types/text/parameter_value.h +++ b/include/sqlpp11/data_types/text/parameter_value.h @@ -26,7 +26,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include @@ -34,7 +34,7 @@ #include #include -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L #include #endif @@ -53,7 +53,7 @@ namespace sqlpp target._bind_text_parameter(index, &_value, _is_null); } -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L parameter_value_base& operator=(const std::string_view& val) { _value = val; diff --git a/include/sqlpp11/data_types/text/wrap_operand.h b/include/sqlpp11/data_types/text/wrap_operand.h index 14f9d860..7e5cf680 100644 --- a/include/sqlpp11/data_types/text/wrap_operand.h +++ b/include/sqlpp11/data_types/text/wrap_operand.h @@ -26,10 +26,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L #include #endif #include @@ -39,7 +39,7 @@ namespace sqlpp { struct text_operand; -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L using checked_type = std::string_view; #else using checked_type = std::string; diff --git a/include/sqlpp11/result.h b/include/sqlpp11/result.h index 69023d1e..df36670b 100644 --- a/include/sqlpp11/result.h +++ b/include/sqlpp11/result.h @@ -26,7 +26,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include @@ -83,7 +83,7 @@ namespace sqlpp class iterator { public: -#if CXX_STD_VER >= 202002L +#if SQLPP_CXX_STD >= 202002L using iterator_concept = std::input_iterator_tag; #else // LegacyInputIterator describes best our iterator's capabilities. However our iterator does not diff --git a/tests/core/serialize/Insert.cpp b/tests/core/serialize/Insert.cpp index 9285515a..d771d7cd 100644 --- a/tests/core/serialize/Insert.cpp +++ b/tests/core/serialize/Insert.cpp @@ -23,7 +23,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include "compare.h" #include "Sample.h" @@ -49,7 +49,7 @@ int Insert(int, char* []) "INSERT INTO tab_bar (beta,gamma) VALUES('cheesecake'," + getTrue() + ")"); compare(__LINE__, insert_into(bar).set(bar.beta = ::sqlpp::null, bar.gamma = true), "INSERT INTO tab_bar (beta,gamma) VALUES(NULL," + getTrue() + ")"); -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L // string_view argument std::string_view cheeseCake = "cheesecake"; compare(__LINE__, insert_into(bar).set(bar.beta = cheeseCake, bar.gamma = true), diff --git a/tests/core/serialize/Where.cpp b/tests/core/serialize/Where.cpp index a645d4ba..8e1f894c 100644 --- a/tests/core/serialize/Where.cpp +++ b/tests/core/serialize/Where.cpp @@ -23,7 +23,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include "compare.h" #include "Sample.h" @@ -70,7 +70,7 @@ int Where(int, char*[]) compare(__LINE__, where(is_equal_to_or_null(bar.beta, ::sqlpp::value_or_null("SQL"))), " WHERE (tab_bar.beta='SQL')"); compare(__LINE__, where(is_equal_to_or_null(bar.beta, ::sqlpp::value_or_null(::sqlpp::null))), " WHERE tab_bar.beta IS NULL"); -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L // string_view argument std::string_view sqlString = "SQL"; compare(__LINE__, where(bar.beta == sqlString), " WHERE (tab_bar.beta='SQL')"); diff --git a/tests/core/usage/Insert.cpp b/tests/core/usage/Insert.cpp index 7f768214..93b2969e 100644 --- a/tests/core/usage/Insert.cpp +++ b/tests/core/usage/Insert.cpp @@ -23,13 +23,13 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include "MockDb.h" #include "Sample.h" #include "is_regular.h" #include -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L #include #endif #include @@ -111,7 +111,7 @@ int Insert(int, char*[]) prepared_insert.params.delta = sqlpp::value_or_null(17); db(prepared_insert); -#if CXX_STD_VER >= 201703L +#if SQLPP_CXX_STD >= 201703L auto prepared_insert_sv = db.prepare(insert_into(t).set(t.gamma = parameter(t.gamma), t.delta = parameter(t.delta), t.beta = parameter(t.beta))); prepared_insert_sv.params.gamma = true; prepared_insert_sv.params.delta = 17;