Date: Tue, 2 Sep 2014 11:16:44 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270964 - head/sys/sys Message-ID: <201409021116.s82BGiXI071065@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Tue Sep 2 11:16:44 2014 New Revision: 270964 URL: http://svnweb.freebsd.org/changeset/base/270964 Log: Clean up <sys/cdefs.h> slightly. - Remove c++0x hack from <sys/cdefs.h> that was needed when Clang did not fully implement C++11. We can now safely test against C++11 to check whether thread_local is available, like we do for all other C++11 keywords. - Don't use __clang__ to test for thread safety annotation presence. It turns out we have a proper attribute for this. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Sep 2 10:35:04 2014 (r270963) +++ head/sys/sys/cdefs.h Tue Sep 2 11:16:44 2014 (r270964) @@ -298,8 +298,7 @@ #endif #if !__has_extension(c_thread_local) -/* XXX: Change this to test against C++11 when clang in base supports it. */ -#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ +#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_thread_local) #define _Thread_local thread_local #else @@ -751,7 +750,7 @@ * held. */ -#ifdef __clang__ +#if __has_extension(c_thread_safety_attributes) #define __lock_annotate(x) __attribute__((x)) #else #define __lock_annotate(x)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409021116.s82BGiXI071065>