summaryrefslogtreecommitdiff
path: root/platform/default/sqlite3.cpp
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-09-12 12:10:34 -0700
committerKonstantin Käfer <mail@kkaefer.com>2018-09-21 12:13:26 +0200
commitd5f0e4b41e0ece7795a350cc6b9b68fc3aa356ce (patch)
treec9ab59cd625ac987eaab91d8249cdaceec2b0185 /platform/default/sqlite3.cpp
parent2ea0833ecf46ba6a38211e980a9200e7f4419bd8 (diff)
downloadqtlocation-mapboxgl-d5f0e4b41e0ece7795a350cc6b9b68fc3aa356ce.tar.gz
Use named function instead of lambda for SQlite3 log config
Diffstat (limited to 'platform/default/sqlite3.cpp')
-rw-r--r--platform/default/sqlite3.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/platform/default/sqlite3.cpp b/platform/default/sqlite3.cpp
index faaa85efd8..f7c6efc10d 100644
--- a/platform/default/sqlite3.cpp
+++ b/platform/default/sqlite3.cpp
@@ -97,6 +97,13 @@ public:
template <typename T>
using optional = std::experimental::optional<T>;
+
+#ifndef NDEBUG
+void logSqlMessage(void *, const int err, const char *msg) {
+ mbgl::Log::Record(mbgl::EventSeverity::Debug, mbgl::Event::Database, err, "%s", msg);
+}
+#endif
+
__attribute__((constructor))
static void initalize() {
if (sqlite3_libversion_number() / 1000000 != SQLITE_VERSION_NUMBER / 1000000) {
@@ -109,9 +116,7 @@ static void initalize() {
#ifndef NDEBUG
// Enable SQLite logging before initializing the database.
- sqlite3_config(SQLITE_CONFIG_LOG, [](void *, const int err, const char *msg) {
- mbgl::Log::Record(mbgl::EventSeverity::Debug, mbgl::Event::Database, err, "%s", msg);
- }, nullptr);
+ sqlite3_config(SQLITE_CONFIG_LOG, &logSqlMessage, nullptr);
#endif
}