Skip to content

Commit 5eabab7

Browse files
committed
[sqlpp11] Port mod to avoid warnings
1 parent 3d5dc07 commit 5eabab7

File tree

6 files changed

+344
-0
lines changed

6 files changed

+344
-0
lines changed
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
From 3b8f4092f74f5a501af7082238b865242ca0da44 Mon Sep 17 00:00:00 2001
2+
From: Roland Bock <rbock@eudoxos.de>
3+
Date: Sun, 7 Sep 2025 09:10:11 +0200
4+
Subject: [PATCH] Conditional include for ciso646, #626
5+
6+
---
7+
include/sqlpp11/data_types/boolean/operand.h | 4 +++-
8+
include/sqlpp11/logic.h | 5 ++++-
9+
include/sqlpp11/mysql/bind_result.h | 11 ++++++-----
10+
include/sqlpp11/mysql/char_result.h | 5 ++++-
11+
include/sqlpp11/postgresql/bind_result.h | 5 ++++-
12+
include/sqlpp11/sqlite3/bind_result.h | 5 ++++-
13+
include/sqlpp11/sqlite3/prepared_statement.h | 5 ++++-
14+
include/sqlpp11/transaction.h | 6 +++++-
15+
8 files changed, 34 insertions(+), 12 deletions(-)
16+
17+
diff --git a/include/sqlpp11/data_types/boolean/operand.h b/include/sqlpp11/data_types/boolean/operand.h
18+
index b22c78209..03171ea21 100644
19+
--- a/include/sqlpp11/data_types/boolean/operand.h
20+
+++ b/include/sqlpp11/data_types/boolean/operand.h
21+
@@ -26,7 +26,9 @@
22+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+
*/
24+
25+
-#include <ciso646> // Required for some compilers to use aliases for boolean operators
26+
+#ifdef _MSC_VER
27+
+#include <ciso646> // Required to support boolean operator aliases
28+
+#endif
29+
30+
#include <sqlpp11/type_traits.h>
31+
#include <sqlpp11/alias_operators.h>
32+
diff --git a/include/sqlpp11/logic.h b/include/sqlpp11/logic.h
33+
index be3ffd332..fa0066455 100644
34+
--- a/include/sqlpp11/logic.h
35+
+++ b/include/sqlpp11/logic.h
36+
@@ -26,7 +26,10 @@
37+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38+
*/
39+
40+
-#include <ciso646> // Required for some compilers to use aliases for boolean operators
41+
+#ifdef _MSC_VER
42+
+#include <ciso646> // Required to support boolean operator aliases
43+
+#endif
44+
+
45+
#include <type_traits>
46+
47+
namespace sqlpp
48+
diff --git a/include/sqlpp11/mysql/bind_result.h b/include/sqlpp11/mysql/bind_result.h
49+
index 0a2126720..ac1b2239e 100644
50+
--- a/include/sqlpp11/mysql/bind_result.h
51+
+++ b/include/sqlpp11/mysql/bind_result.h
52+
@@ -26,18 +26,19 @@
53+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54+
*/
55+
56+
+#ifdef _MSC_VER
57+
+#include <ciso646> // Required to support boolean operator aliases
58+
+#endif
59+
+
60+
#include <limits>
61+
+#include <iostream>
62+
+#include <memory>
63+
64+
#include <sqlpp11/chrono.h>
65+
#include <sqlpp11/exception.h>
66+
#include <sqlpp11/mysql/detail/prepared_statement_handle.h>
67+
#include <sqlpp11/mysql/sqlpp_mysql.h>
68+
69+
-#include <iostream>
70+
-#ifdef _MSC_VER
71+
-#include <iso646.h>
72+
-#endif
73+
-#include <memory>
74+
75+
namespace sqlpp
76+
{
77+
diff --git a/include/sqlpp11/mysql/char_result.h b/include/sqlpp11/mysql/char_result.h
78+
index a3cfc6f97..979fd4d5b 100644
79+
--- a/include/sqlpp11/mysql/char_result.h
80+
+++ b/include/sqlpp11/mysql/char_result.h
81+
@@ -26,7 +26,10 @@
82+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
83+
*/
84+
85+
-#include <ciso646>
86+
+#ifdef _MSC_VER
87+
+#include <ciso646> // Required to support boolean operator aliases
88+
+#endif
89+
+
90+
#include <cstdlib>
91+
#include <iostream>
92+
#include <memory>
93+
diff --git a/include/sqlpp11/postgresql/bind_result.h b/include/sqlpp11/postgresql/bind_result.h
94+
index 9dc7086ef..15c838767 100644
95+
--- a/include/sqlpp11/postgresql/bind_result.h
96+
+++ b/include/sqlpp11/postgresql/bind_result.h
97+
@@ -27,6 +27,10 @@
98+
* POSSIBILITY OF SUCH DAMAGE.
99+
*/
100+
101+
+#ifdef _MSC_VER
102+
+#include <ciso646> // Required to support boolean operator aliases
103+
+#endif
104+
+
105+
#include <sqlpp11/chrono.h>
106+
#include <sqlpp11/data_types.h>
107+
#include <sqlpp11/detail/parse_date_time.h>
108+
@@ -39,7 +43,6 @@
109+
#include "detail/prepared_statement_handle.h"
110+
111+
#ifdef _MSC_VER
112+
-#include <iso646.h>
113+
#pragma warning(disable : 4800) // int to bool
114+
#endif
115+
namespace sqlpp
116+
diff --git a/include/sqlpp11/sqlite3/bind_result.h b/include/sqlpp11/sqlite3/bind_result.h
117+
index 95405f180..f43949808 100644
118+
--- a/include/sqlpp11/sqlite3/bind_result.h
119+
+++ b/include/sqlpp11/sqlite3/bind_result.h
120+
@@ -26,6 +26,10 @@
121+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
122+
*/
123+
124+
+#ifdef _MSC_VER
125+
+#include <ciso646> // Required to support boolean operator aliases
126+
+#endif
127+
+
128+
#include <sqlpp11/chrono.h>
129+
#include <sqlpp11/detail/parse_date_time.h>
130+
#include <sqlpp11/exception.h>
131+
@@ -36,7 +40,6 @@
132+
#include <memory>
133+
134+
#ifdef _MSC_VER
135+
-#include <iso646.h>
136+
#pragma warning(push)
137+
#pragma warning(disable : 4251)
138+
#endif
139+
diff --git a/include/sqlpp11/sqlite3/prepared_statement.h b/include/sqlpp11/sqlite3/prepared_statement.h
140+
index 4c84232c1..78a6dc67d 100644
141+
--- a/include/sqlpp11/sqlite3/prepared_statement.h
142+
+++ b/include/sqlpp11/sqlite3/prepared_statement.h
143+
@@ -26,8 +26,11 @@
144+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145+
*/
146+
147+
+#ifdef _MSC_VER
148+
+#include <ciso646> // Required to support boolean operator aliases
149+
+#endif
150+
+
151+
#include <memory>
152+
-#include <ciso646>
153+
#include <cmath>
154+
#include <string>
155+
#include <vector>
156+
diff --git a/include/sqlpp11/transaction.h b/include/sqlpp11/transaction.h
157+
index 9635edbd6..0eb9a0c38 100644
158+
--- a/include/sqlpp11/transaction.h
159+
+++ b/include/sqlpp11/transaction.h
160+
@@ -26,9 +26,13 @@
161+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
162+
*/
163+
164+
+#ifdef _MSC_VER
165+
+#include <ciso646> // Required to support boolean operator aliases
166+
+#endif
167+
+
168+
#include <stdexcept>
169+
#include <string>
170+
-#include <ciso646>
171+
+
172+
173+
namespace sqlpp
174+
{
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index bb05cd8..4e83094 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -113,7 +113,7 @@ endif()
6+
### Packaging
7+
install(PROGRAMS ${PROJECT_SOURCE_DIR}/scripts/ddl2cpp
8+
RENAME sqlpp11-ddl2cpp
9+
- DESTINATION ${CMAKE_INSTALL_BINDIR}
10+
+ DESTINATION tools/sqlpp11
11+
)
12+
13+
write_basic_package_version_file(Sqlpp11ConfigVersion.cmake
14+
diff --git a/cmake/configs/Sqlpp11Config.cmake b/cmake/configs/Sqlpp11Config.cmake
15+
index bf340d6..249014d 100644
16+
--- a/cmake/configs/Sqlpp11Config.cmake
17+
+++ b/cmake/configs/Sqlpp11Config.cmake
18+
@@ -55,7 +55,7 @@ endforeach()
19+
20+
# Import "ddl2cpp" script
21+
if(NOT TARGET sqlpp11::ddl2cpp)
22+
- get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH)
23+
+ get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../tools/sqlpp11/sqlpp11-ddl2cpp" REALPATH)
24+
if(NOT EXISTS "${sqlpp11_ddl2cpp_location}")
25+
message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.")
26+
endif()
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index bb05cd8..6aff88b 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -51,11 +51,13 @@ set(SQLPP11_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Sqlpp11 CACHE STRING
6+
7+
### Dependencies
8+
if(DEPENDENCY_CHECK AND BUILD_MYSQL_CONNECTOR)
9+
- find_package(MySQL REQUIRED)
10+
+ find_package(MySQL NAMES unofficial-libmysql REQUIRED)
11+
+ add_library(MySQL::MySQL ALIAS unofficial::libmysql::libmysql)
12+
endif()
13+
14+
if(DEPENDENCY_CHECK AND BUILD_MARIADB_CONNECTOR)
15+
- find_package(MariaDB REQUIRED)
16+
+ find_package(MariaDB NAMES unofficial-libmariadb REQUIRED)
17+
+ add_library(MariaDB::MariaDB ALIAS unofficial::libmariadb)
18+
endif()
19+
20+
if(DEPENDENCY_CHECK AND BUILD_POSTGRESQL_CONNECTOR)
21+
diff --git a/cmake/configs/Sqlpp11MariaDBConfig.cmake b/cmake/configs/Sqlpp11MariaDBConfig.cmake
22+
index 32a594a..fb63205 100644
23+
--- a/cmake/configs/Sqlpp11MariaDBConfig.cmake
24+
+++ b/cmake/configs/Sqlpp11MariaDBConfig.cmake
25+
@@ -1,2 +1,2 @@
26+
include(CMakeFindDependencyMacro)
27+
-find_dependency(MariaDB)
28+
\ No newline at end of file
29+
+find_dependency(unofficial-libmariadb)
30+
diff --git a/cmake/configs/Sqlpp11MySQLConfig.cmake b/cmake/configs/Sqlpp11MySQLConfig.cmake
31+
index 0d2a5b3..53dab6e 100644
32+
--- a/cmake/configs/Sqlpp11MySQLConfig.cmake
33+
+++ b/cmake/configs/Sqlpp11MySQLConfig.cmake
34+
@@ -1,2 +1,2 @@
35+
include(CMakeFindDependencyMacro)
36+
-find_dependency(MySQL)
37+
\ No newline at end of file
38+
+find_dependency(unofficial-libmysql)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/include/sqlpp11/mysql/sqlpp_mysql.h b/include/sqlpp11/mysql/sqlpp_mysql.h
2+
index 4257c7a..1408037 100644
3+
--- a/include/sqlpp11/mysql/sqlpp_mysql.h
4+
+++ b/include/sqlpp11/mysql/sqlpp_mysql.h
5+
@@ -26,7 +26,7 @@
6+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7+
*/
8+
9+
-#include <mysql.h>
10+
+#include <mysql/mysql.h>
11+
12+
namespace sqlpp
13+
{
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
set(VCPKG_BUILD_TYPE release) # header-only lib
2+
3+
vcpkg_from_github(
4+
OUT_SOURCE_PATH SOURCE_PATH
5+
REPO rbock/sqlpp11
6+
REF 3b8f4092f74f5a501af7082238b865242ca0da44
7+
SHA512 5b79509fa0c66d0465284991f1dfbd66043ad98ff685125006f61a088cd3ecee5dee11deadb66c145d385023d622df8d6872d9524532a901477dd1bba3770688
8+
HEAD_REF main
9+
PATCHES
10+
ddl2cpp_path.patch
11+
dependencies.diff
12+
fix-miss-header.patch
13+
)
14+
15+
vcpkg_check_features(
16+
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
17+
FEATURES
18+
sqlite3 BUILD_SQLITE3_CONNECTOR
19+
mariadb BUILD_MARIADB_CONNECTOR
20+
mysql BUILD_MYSQL_CONNECTOR
21+
postgresql BUILD_POSTGRESQL_CONNECTOR
22+
)
23+
24+
vcpkg_cmake_configure(
25+
SOURCE_PATH "${SOURCE_PATH}"
26+
OPTIONS
27+
-DBUILD_TESTING:BOOL=OFF
28+
-DSQLPP11_INSTALL_CMAKEDIR=share/${PORT}
29+
-DUSE_SYSTEM_DATE:BOOL=ON
30+
${FEATURE_OPTIONS}
31+
)
32+
33+
vcpkg_cmake_install()
34+
vcpkg_cmake_config_fixup()
35+
36+
set(usage "sqlpp11 provides CMake targets:\n")
37+
if(FEATURES STREQUAL "core")
38+
set(usage "This build of sqlpp11 doesn't include any connector.\n(Available via features: sqlite3, mariadb, mysql, postgresql.)\n")
39+
endif()
40+
foreach(component IN ITEMS SQLite3 SQLCipher MySQL MariaDB PostgreSQL)
41+
string(TOLOWER "${component}" lib)
42+
if("${lib}" IN_LIST FEATURES)
43+
string(APPEND usage "\n find_package(Sqlpp11 CONFIG REQUIRED COMPONENTS ${component})\n target_link_libraries(main PRIVATE sqlpp11::${lib})\n")
44+
endif()
45+
endforeach()
46+
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage}")
47+
48+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "sqlpp11",
3+
"version": "0.65",
4+
"port-version": 1,
5+
"description": "A type safe embedded domain specific language for SQL queries and results in C++.",
6+
"homepage": "https://github.com/rbock/sqlpp11",
7+
"license": "BSD-2-Clause",
8+
"dependencies": [
9+
"date",
10+
{
11+
"name": "vcpkg-cmake",
12+
"host": true
13+
},
14+
{
15+
"name": "vcpkg-cmake-config",
16+
"host": true
17+
}
18+
],
19+
"features": {
20+
"mariadb": {
21+
"description": "Use MariaDB connector",
22+
"dependencies": [
23+
"libmariadb"
24+
]
25+
},
26+
"mysql": {
27+
"description": "Use MySQL connector",
28+
"dependencies": [
29+
"libmysql"
30+
]
31+
},
32+
"postgresql": {
33+
"description": "Use PostgreSQL connector",
34+
"dependencies": [
35+
"libpq"
36+
]
37+
},
38+
"sqlite3": {
39+
"description": "Use SQLite3 connector",
40+
"dependencies": [
41+
"sqlite3"
42+
]
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)