Skip to content

Commit

Permalink
Only define no_discard for clang >= 3.9.0 (AOMediaCodec#1951)
Browse files Browse the repository at this point in the history
godbolt shows that's when it was also define for enums.
This fixes AOMediaCodec#1947
  • Loading branch information
vrabaud authored Jan 18, 2024
1 parent 4984c7f commit e146a00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/avif/avif.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern "C" {
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
#define AVIF_NODISCARD [[nodiscard]]
#else
#if defined(__clang__) && defined(__has_attribute)
#if defined(__clang__) && defined(__has_attribute) && ((__clang_major__ << 8) | __clang_minor__) >= ((3 << 8) | 9)
#if __has_attribute(warn_unused_result)
#define AVIF_NODISCARD __attribute__((warn_unused_result))
#else
Expand Down

0 comments on commit e146a00

Please sign in to comment.