12
12
13
13
#include < SQLiteCpp/Column.h>
14
14
15
- #if (__cplusplus >= 201703L) || ( defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)) // c++17: Visual Studio 2017 version 15.7
15
+ // c++17: MinGW GCC version > 8
16
+ // c++17: Visual Studio 2017 version 15.7
17
+ #if ((__cplusplus >= 201703L) && ((!defined(__MINGW32__) && !defined(__MINGW64__)) || (__GNUC__ > 8))) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))
16
18
#include < filesystem>
17
19
#endif // c++17
18
20
@@ -155,12 +157,15 @@ class Database
155
157
{
156
158
}
157
159
158
- #if (__cplusplus >= 201703L) || ( defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)) // c++17: Visual Studio 2017 version 15.7
160
+ // c++17: MinGW GCC version > 8
161
+ // c++17: Visual Studio 2017 version 15.7
162
+ #if ((__cplusplus >= 201703L) && ((!defined(__MINGW32__) && !defined(__MINGW64__)) || (__GNUC__ > 8))) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))
163
+
159
164
/* *
160
165
* @brief Open the provided database std::filesystem::path.
161
166
*
162
167
* @note This feature requires std=C++17
163
- *
168
+ *
164
169
* Uses sqlite3_open_v2() with readonly default flag, which is the opposite behavior
165
170
* of the old sqlite3_open() function (READWRITE+CREATE).
166
171
* This makes sense if you want to use it on a readonly filesystem
@@ -179,7 +184,8 @@ class Database
179
184
const int aFlags = SQLite::OPEN_READONLY,
180
185
const int aBusyTimeoutMs = 0 ,
181
186
const std::string& aVfs = " " ) :
182
- Database(apFilename.c_str(), aFlags, aBusyTimeoutMs, aVfs.empty() ? nullptr : aVfs.c_str())
187
+ Database(reinterpret_cast <const char *>(apFilename.u8string().c_str()),
188
+ aFlags, aBusyTimeoutMs, aVfs.empty() ? nullptr : aVfs.c_str())
183
189
{
184
190
}
185
191
@@ -280,7 +286,7 @@ class Database
280
286
* @see exec() to execute, returning number of rows modified
281
287
*
282
288
* @param[in] aQueries one or multiple UTF-8 encoded, semicolon-separate SQL statements
283
- *
289
+ *
284
290
* @return the sqlite result code.
285
291
*/
286
292
int tryExec (const char * apQueries) noexcept ;
@@ -296,7 +302,7 @@ class Database
296
302
* @see exec() to execute, returning number of rows modified
297
303
*
298
304
* @param[in] aQueries one or multiple UTF-8 encoded, semicolon-separate SQL statements
299
- *
305
+ *
300
306
* @return the sqlite result code.
301
307
*/
302
308
int tryExec (const std::string aQueries) noexcept
@@ -510,7 +516,7 @@ class Database
510
516
* This function reads the first 100 bytes of a SQLite database file
511
517
* and reconstructs groups of individual bytes into the associated fields
512
518
* in a Header object.
513
- *
519
+ *
514
520
* @param[in] aFilename path/uri to a file
515
521
*
516
522
* @return Header object containing file data
0 commit comments