diff options
author | David Robillard <d@drobilla.net> | 2020-07-15 23:01:31 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-07-16 11:13:59 +0200 |
commit | 11240bf0317b8b6c9a62b7328db51899c0791842 (patch) | |
tree | 0cdd8abb90c9e25c4f7e6207eb4b7ed1c575f00e /lv2 | |
parent | 415d38d90512a9500d6e6c58ade51be0e4d455dc (diff) | |
download | lv2-11240bf0317b8b6c9a62b7328db51899c0791842.tar.xz |
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.
Diffstat (limited to 'lv2')
-rw-r--r-- | lv2/core/attributes.h | 6 |
1 files 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 |