From d4092e2936524c4cf003b6ef8d90d6b9a28b8ba5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 16 Jul 2020 12:30:28 +0200 Subject: Modernize compiler version checks Avoids a warning on compilers where __GNUC__ is not defined. --- lilv/lilvmm.hpp | 4 ++-- test/test_value.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lilv/lilvmm.hpp b/lilv/lilvmm.hpp index 5a044b6..cf719dd 100644 --- a/lilv/lilvmm.hpp +++ b/lilv/lilvmm.hpp @@ -24,7 +24,7 @@ namespace Lilv { #if defined(__clang__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdeprecated-declarations" -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#elif defined(__GNUC__) && __GNUC__ > 4 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif @@ -37,7 +37,7 @@ uri_to_path(const char* uri) { #if defined(__clang__) # pragma clang diagnostic pop -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#elif defined(__GNUC__) && __GNUC__ > 4 # pragma GCC diagnostic pop #endif diff --git a/test/test_value.c b/test/test_value.c index ce95166..fc470e1 100644 --- a/test/test_value.c +++ b/test/test_value.c @@ -72,7 +72,7 @@ main(void) #if defined(__clang__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdeprecated-declarations" -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#elif defined(__GNUC__) && __GNUC__ > 4 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif @@ -81,7 +81,7 @@ main(void) #if defined(__clang__) # pragma clang diagnostic pop -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#elif defined(__GNUC__) && __GNUC__ > 4 # pragma GCC diagnostic pop #endif -- cgit v1.2.1