mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:51:15 -03: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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user