Fix GCC5 complaining about -Wunused-variable.

This commit is contained in:
Thomas Voß
2015-11-25 14:23:13 +01:00
parent 146533e377
commit 3f786c7171
4 changed files with 12 additions and 1 deletions

View File

@@ -11,6 +11,8 @@
#include <mbgl/platform/default/image_reader.hpp>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
// Check png library version.
const static bool png_version_check = []() {
const png_uint_32 version = png_access_version_number();
@@ -22,7 +24,7 @@ const static bool png_version_check = []() {
}
return true;
}();
#pragma GCC diagnostic pop
namespace mbgl {
namespace util {

View File

@@ -5,6 +5,8 @@
#include <cstring>
#include <cstdio>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
// Check sqlite3 library version.
const static bool sqliteVersionCheck = []() {
if (sqlite3_libversion_number() / 1000000 != SQLITE_VERSION_NUMBER / 1000000) {
@@ -17,6 +19,7 @@ const static bool sqliteVersionCheck = []() {
return true;
}();
#pragma GCC diagnostic pop
namespace mapbox {
namespace sqlite {

View File

@@ -6,6 +6,8 @@
#include <cstring>
#include <stdexcept>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
// Check zlib library version.
const static bool zlibVersionCheck = []() {
@@ -20,6 +22,7 @@ const static bool zlibVersionCheck = []() {
return true;
}();
#pragma GCC diagnostic pop
namespace mbgl {
namespace util {

View File

@@ -4,12 +4,15 @@
#include <uv.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
// Check libuv library version.
const static bool uvVersionCheck = []() {
const unsigned int version = uv_version();
const unsigned int major = (version >> 16) & 0xFF;
const unsigned int minor = (version >> 8) & 0xFF;
const unsigned int patch = version & 0xFF;
#pragma GCC diagnostic pop
#ifndef UV_VERSION_PATCH
// 0.10 doesn't have UV_VERSION_PATCH defined, so we "fake" it by using the library patch level.