Date: Fri, 28 Aug 2015 14:06:29 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287254 - head/sys/sys Message-ID: <201508281406.t7SE6TYQ002370@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Fri Aug 28 14:06:28 2015 New Revision: 287254 URL: https://svnweb.freebsd.org/changeset/base/287254 Log: Be more GCC-friendly with attributes Being clang the default compiler, we were always giving precedence to the __has_attribute check. Unfortunately clang generally doesn't support the new attributes (alloc_size was briefly supported and then reverted) so we were always doing both checks. Give the precedence to GCC as that is the working case now. Do the same for __has_builtin() for consistency. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Aug 28 13:57:30 2015 (r287253) +++ head/sys/sys/cdefs.h Fri Aug 28 14:06:28 2015 (r287254) @@ -237,12 +237,12 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) #define __alloc_size(x) __attribute__((__alloc_size__(x))) #else #define __alloc_size(x) #endif -#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) +#if __GNUC_PREREQ__(4, 9) || __has_attribute(alloc_align) #define __alloc_align(x) __attribute__((__alloc_align__(x))) #else #define __alloc_align(x) @@ -382,7 +382,7 @@ #define __returns_twice #endif -#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) +#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) #define __unreachable() __builtin_unreachable() #else #define __unreachable() ((void)0) @@ -535,7 +535,7 @@ * well enough to use them in limited cases. */ #if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __has_attribute(artificial) || __GNUC_PREREQ__(4, 3) +#if __GNUC_PREREQ__(4, 3) || __has_attribute(artificial) #define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) #else #define __gnu_inline __attribute__((__gnu_inline__))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508281406.t7SE6TYQ002370>