mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 15:18:50 +08:00
Stub out __has_attribute if not defined
Otherwise compilers that don't even have __has_attribute fail. Fixes #7554
This commit is contained in:
parent
1083cd2640
commit
8087f603ad
|
@ -181,7 +181,13 @@
|
|||
|
||||
/* Like __warn_unused, but applies to a type.
|
||||
At the moment only clang supports this as a type attribute.
|
||||
|
||||
We need to check for __has_attribute being a thing before or old gcc fails - #7554.
|
||||
*/
|
||||
#ifndef __has_attribute
|
||||
#define __has_attribute(x) 0 // Compatibility with non-clang and old gcc compilers.
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) && __has_attribute(warn_unused_result)
|
||||
#ifndef __warn_unused_type
|
||||
#define __warn_unused_type __attribute__ ((warn_unused_result))
|
||||
|
|
Loading…
Reference in New Issue
Block a user