From b965b2a1df8a4b970fb9a4a34f47ec14ef377fd4 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Fri, 4 Mar 2022 07:49:05 +0100 Subject: [PATCH] Fix warnings (#422) --- include/sqlpp11/postgresql/bind_result.h | 2 +- include/sqlpp11/postgresql/result.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/sqlpp11/postgresql/bind_result.h b/include/sqlpp11/postgresql/bind_result.h index 6f655b44..ba13be47 100644 --- a/include/sqlpp11/postgresql/bind_result.h +++ b/include/sqlpp11/postgresql/bind_result.h @@ -38,7 +38,7 @@ #include "detail/prepared_statement_handle.h" -#if defined(_WIN32) || defined(_WIN64) +#ifdef _MSC_VER #pragma warning(disable : 4800) // int to bool #endif namespace sqlpp diff --git a/include/sqlpp11/postgresql/result.h b/include/sqlpp11/postgresql/result.h index 28a8a374..d985ce3c 100644 --- a/include/sqlpp11/postgresql/result.h +++ b/include/sqlpp11/postgresql/result.h @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -299,8 +300,15 @@ namespace sqlpp case PGRES_FATAL_ERROR: Err = PQresultErrorMessage(m_result); break; +#if PG_MAJORVERSION_NUM >= 13 case PGRES_COPY_BOTH: case PGRES_SINGLE_TUPLE: +#endif +#if PG_MAJORVERSION_NUM >= 14 + case PGRES_PIPELINE_SYNC: + case PGRES_PIPELINE_ABORTED: +#endif + default: throw sqlpp::exception("pqxx::result: Unrecognized response code " + std::to_string(PQresultStatus(m_result))); }