From 60a6e9a417de4d5a1a98a36b8f227a9a767f7dc0 Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Fri, 1 Jan 2021 22:39:12 +0100 Subject: [PATCH] Make pragmas conditional to clang. --- src/common/repository/KeyValueRepository.hxx | 4 ++++ src/common/repository/sqlite/SqliteDatabase.hxx | 4 ++++ src/common/repository/sqlite/SqliteStatement.hxx | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/common/repository/KeyValueRepository.hxx b/src/common/repository/KeyValueRepository.hxx index 5b943f173..ddc80e039 100644 --- a/src/common/repository/KeyValueRepository.hxx +++ b/src/common/repository/KeyValueRepository.hxx @@ -23,8 +23,10 @@ #include "Variant.hxx" #include "bspf.hxx" +#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Woverloaded-virtual" +#endif class KeyValueRepositoryAtomic; @@ -54,6 +56,8 @@ class KeyValueRepositoryAtomic : public KeyValueRepository { KeyValueRepositoryAtomic* atomic() override { return this; } }; +#ifdef __clang__ #pragma clang diagnostic pop +#endif #endif // KEY_VALUE_REPOSITORY_HXX diff --git a/src/common/repository/sqlite/SqliteDatabase.hxx b/src/common/repository/sqlite/SqliteDatabase.hxx index 71316a4b4..cdbe7be5b 100644 --- a/src/common/repository/sqlite/SqliteDatabase.hxx +++ b/src/common/repository/sqlite/SqliteDatabase.hxx @@ -59,8 +59,10 @@ class SqliteDatabase // IMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// +#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif template void SqliteDatabase::exec(const string& sql, T arg1, Ts... args) const @@ -73,6 +75,8 @@ void SqliteDatabase::exec(const string& sql, T arg1, Ts... args) const exec(buffer); } +#ifdef __clang__ #pragma clang diagnostic pop +#endif #endif // SQLITE_DATABASE_HXX diff --git a/src/common/repository/sqlite/SqliteStatement.hxx b/src/common/repository/sqlite/SqliteStatement.hxx index 42b91be90..3ef4e3ec0 100644 --- a/src/common/repository/sqlite/SqliteStatement.hxx +++ b/src/common/repository/sqlite/SqliteStatement.hxx @@ -67,8 +67,10 @@ class SqliteStatement { // IMPLEMENTATION /////////////////////////////////////////////////////////////////////////////// +#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif template SqliteStatement::SqliteStatement(sqlite3* handle, const string& sql, T arg1, Ts... args) @@ -82,6 +84,8 @@ SqliteStatement::SqliteStatement(sqlite3* handle, const string& sql, T arg1, Ts. initialize(buffer); } +#ifdef __clang__ #pragma clang diagnostic pop +#endif #endif // SQLITE_STATEMENT_HXX