Fix #317 Visual Studio 2019 compilation error ('SQLite::Database::Database': delegating constructor calls itself) (#318)

* Visual Studio 2019 compilation error ('SQLite::Database::Database': delegating constructor calls itself) #317

* Visual Studio 2019 compilation error ('SQLite::Database::Database': delegating constructor calls itself) #317

* Visual Studio 2019 compilation error ('SQLite::Database::Database': delegating constructor calls itself) #317
This commit is contained in:
Ivan Shynkarenka 2021-01-09 10:57:37 +03:00 committed by GitHub
parent ef650e06d6
commit 114f89de30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,9 @@
#include <SQLiteCpp/Column.h> #include <SQLiteCpp/Column.h>
#if (__cplusplus >= 201703L) || ( defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)) // c++17: Visual Studio 2017 version 15.7 // c++17: MinGW GCC version > 8
// c++17: Visual Studio 2017 version 15.7
#if ((__cplusplus >= 201703L) && ((!defined(__MINGW32__) && !defined(__MINGW64__)) || (__GNUC__ > 8))) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))
#include <filesystem> #include <filesystem>
#endif // c++17 #endif // c++17
@ -155,7 +157,10 @@ public:
{ {
} }
#if (__cplusplus >= 201703L) || ( defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)) // c++17: Visual Studio 2017 version 15.7 // c++17: MinGW GCC version > 8
// c++17: Visual Studio 2017 version 15.7
#if ((__cplusplus >= 201703L) && ((!defined(__MINGW32__) && !defined(__MINGW64__)) || (__GNUC__ > 8))) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))
/** /**
* @brief Open the provided database std::filesystem::path. * @brief Open the provided database std::filesystem::path.
* *
@ -179,7 +184,8 @@ public:
const int aFlags = SQLite::OPEN_READONLY, const int aFlags = SQLite::OPEN_READONLY,
const int aBusyTimeoutMs = 0, const int aBusyTimeoutMs = 0,
const std::string& aVfs = "") : const std::string& aVfs = "") :
Database(apFilename.c_str(), aFlags, aBusyTimeoutMs, aVfs.empty() ? nullptr : aVfs.c_str()) Database(reinterpret_cast<const char*>(apFilename.u8string().c_str()),
aFlags, aBusyTimeoutMs, aVfs.empty() ? nullptr : aVfs.c_str())
{ {
} }