diff options
author | ed <ed@FreeBSD.org> | 2014-09-02 11:16:44 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2014-09-02 11:16:44 +0000 |
commit | 2a766477ec816475821f4c92c496f21c4fcc93d6 (patch) | |
tree | 8a0ae948f1112443ec96357e097bec4a277ede44 /sys/sys/cdefs.h | |
parent | 8b014a347bf609febfd59128c02baa9e1b0a128e (diff) | |
download | FreeBSD-src-2a766477ec816475821f4c92c496f21c4fcc93d6.zip FreeBSD-src-2a766477ec816475821f4c92c496f21c4fcc93d6.tar.gz |
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.
Diffstat (limited to 'sys/sys/cdefs.h')
-rw-r--r-- | sys/sys/cdefs.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index a8d4baf..d00d7ad 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -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) |