diff options
author | Oneric <oneric@oneric.stub> | 2022-02-16 20:37:43 +0100 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2022-02-19 16:47:57 +0100 |
commit | 8622c03b68780be087dfdde0380333099724bbee (patch) | |
tree | f9056093b45b978209cc5ccd4cf23fea5babd406 | |
parent | 75844e4ed6b4e9b47dee2fae32f80833d7ae1641 (diff) | |
download | libass-8622c03b68780be087dfdde0380333099724bbee.tar.bz2 libass-8622c03b68780be087dfdde0380333099724bbee.tar.xz |
ass.h: fix compilation with old gcc
While the deprecated attribute wass added to GCC in
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e23bd2185fae41772d012231e005b789b3a9e6dc
first released in GCC 3.1.0, support for an argument was only added in
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9b86d6bb25587db93a322bf5778e9892aaa8b776
first released in GCC 4.5.0.
Since we did not check for argument support before,
building with a GCC between the above two changes was broken.
The commit assumes Clang always supported an argument,
but that has not actually been verified.
Reported in https://github.com/libass/libass/issues/595
-rw-r--r-- | libass/ass.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libass/ass.h b/libass/ass.h index d9f3404..6e871fb 100644 --- a/libass/ass.h +++ b/libass/ass.h @@ -31,7 +31,11 @@ extern "C" { #endif #if (defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || defined(__clang__) - #define ASS_DEPRECATED(msg) __attribute__((deprecated(msg))) + #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined(__clang__) + #define ASS_DEPRECATED(msg) __attribute__((deprecated(msg))) + #else + #define ASS_DEPRECATED(msg) __attribute__((deprecated)) + #endif #if __GNUC__ > 5 || defined(__clang__) #define ASS_DEPRECATED_ENUM(msg) __attribute__((deprecated(msg))) #else |