Make pragmas conditional to clang.

This commit is contained in:
Christian Speckner 2021-01-01 22:39:12 +01:00
parent 9feb16b0b9
commit 60a6e9a417
3 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -59,8 +59,10 @@ class SqliteDatabase
// IMPLEMENTATION
///////////////////////////////////////////////////////////////////////////////
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
#endif
template <class T, class ...Ts>
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

View File

@ -67,8 +67,10 @@ class SqliteStatement {
// IMPLEMENTATION
///////////////////////////////////////////////////////////////////////////////
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
#endif
template<class T, class ...Ts>
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