svn commit: r270964 - head/sys/sys
Ed Schouten
ed at FreeBSD.org
Tue Sep 2 11:16:45 UTC 2014
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)
More information about the svn-src-all
mailing list