From 11240bf0317b8b6c9a62b7328db51899c0791842 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Jul 2020 23:01:31 +0200 Subject: Modernize compiler checks in attributes.h These caused warnings in compilers where __GNUC__ is not defined. That could be fixed, but it makes things quite ugly, these versions are quite old at this point, and these features are just for developers. So, instead, simply check the major version instead of the specific minor version to keep things terse. --- lv2/core/attributes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lv2/core/attributes.h b/lv2/core/attributes.h index 7465c22..672d716 100644 --- a/lv2/core/attributes.h +++ b/lv2/core/attributes.h @@ -26,7 +26,7 @@ @{ */ -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +#if defined(__GNUC__) && __GNUC__ > 3 #define LV2_DEPRECATED __attribute__((__deprecated__)) #else #define LV2_DEPRECATED @@ -36,7 +36,7 @@ #define LV2_DISABLE_DEPRECATION_WARNINGS \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#elif defined(__GNUC__) && __GNUC__ > 4 #define LV2_DISABLE_DEPRECATION_WARNINGS \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") @@ -46,7 +46,7 @@ #if defined(__clang__) #define LV2_RESTORE_WARNINGS _Pragma("clang diagnostic pop") -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#elif defined(__GNUC__) && __GNUC__ > 4 #define LV2_RESTORE_WARNINGS _Pragma("GCC diagnostic pop") #else #define LV2_RESTORE_WARNINGS -- cgit v1.2.1