AK: Use __attribute__((name)) for functions everywhere

Clang enforces the ordering that attributes specified with the
`[[attr_name]]` syntax must comes before those defines as
`__attribute__((attr_name))`. We don't want to deal with that, so we
should stick to a single syntax (for functions, at least).

This commit favors the latter, as it's used more widely in the code
(for declaring more "exotic" options), and changing those would be a
larger effort than modifying this single file.
This commit is contained in:
Daniel Bertalan 2021-06-20 16:59:51 +02:00 committed by Ali Mohammad Pur
parent 74535628a8
commit eee44c85d4

View file

@ -28,22 +28,22 @@
#ifdef ALWAYS_INLINE
# undef ALWAYS_INLINE
#endif
#define ALWAYS_INLINE [[gnu::always_inline]] inline
#define ALWAYS_INLINE __attribute__((always_inline)) inline
#ifdef NEVER_INLINE
# undef NEVER_INLINE
#endif
#define NEVER_INLINE [[gnu::noinline]]
#define NEVER_INLINE __attribute__((noinline))
#ifdef FLATTEN
# undef FLATTEN
#endif
#define FLATTEN [[gnu::flatten]]
#define FLATTEN __attribute__((flatten))
#ifdef NO_SANITIZE_ADDRESS
# undef NO_SANITIZE_ADDRESS
#endif
#define NO_SANITIZE_ADDRESS [[gnu::no_sanitize_address]]
#define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
// GCC doesn't have __has_feature but clang does
#ifndef __has_feature