From fa60bc2f869986d794e9de8ad33219e4480969f9 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Fri, 28 Aug 2015 15:36:05 +0000 Subject: [PATCH] Add underscores to attributes when checking for __has_attribute. This is a good practice to avoid confusion with allowed macros. Suggested by: jilles --- sys/sys/cdefs.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 9f9742c2f0f..3eaf17bac2b 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -237,12 +237,12 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif -#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__) #define __alloc_size(x) __attribute__((__alloc_size__(x))) #else #define __alloc_size(x) #endif -#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align) +#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__) #define __alloc_align(x) __attribute__((__alloc_align__(x))) #else #define __alloc_align(x) @@ -535,7 +535,7 @@ * well enough to use them in limited cases. */ #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__) #define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) #else #define __gnu_inline __attribute__((__gnu_inline__)) @@ -787,8 +787,8 @@ * properties that cannot be enforced by the C type system. */ -#if __has_attribute(argument_with_type_tag) && \ - __has_attribute(type_tag_for_datatype) && !defined(lint) +#if __has_attribute(__argument_with_type_tag__) && \ + __has_attribute(__type_tag_for_datatype__) && !defined(lint) #define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \ __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx))) #define __datatype_type_tag(kind, type) \