Author: pfg
Date: Fri Aug 28 15:36:05 2015
New Revision: 287259
URL: https://svnweb.freebsd.org/changeset/base/287259

Log:
  Add underscores to attributes when checking for __has_attribute.
  
  This is a good practice to avoid confusion with allowed macros.
  
  Suggested by: jilles

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h        Fri Aug 28 15:27:55 2015        (r287258)
+++ head/sys/sys/cdefs.h        Fri Aug 28 15:36:05 2015        (r287259)
@@ -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) \
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to