diff options
author | Thomas Weißschuh <[email protected]> | 2024-08-07 23:51:40 +0200 |
---|---|---|
committer | Thomas Weißschuh <[email protected]> | 2024-08-10 17:08:19 +0200 |
commit | 02a62b551cee585f7c2c93f54d1230d5714ff7d4 (patch) | |
tree | cddf153004d369fe40c4df3a4c8b25a20e6f230c /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 1daea158d0aae0770371f3079305a29fdb66829e (diff) |
tools/nolibc: compiler: introduce __nolibc_has_attribute()
Recent compilers support __has_attribute() to check if a certain
compiler attribute is supported.
Unfortunately we have to first check if __has_attribute is supported in
the first place and then if a specific attribute is present.
These two checks can't be folded into a single condition as that would
lead to errors.
Nesting the two conditions like below works, but becomes ugly as soon
as #else blocks are used as those need to be duplicated for both levels
of #if.
#if defined __has_attribute
# if __has_attribute (nonnull)
# define ATTR_NONNULL __attribute__ ((nonnull))
# endif
#endif
Introduce a new helper which makes the usage of __has_attribute() nicer
and migrate the current user to it.
Acked-by: Willy Tarreau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Thomas Weißschuh <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions