summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2013-06-03 20:52:20 +0000
committered <ed@FreeBSD.org>2013-06-03 20:52:20 +0000
commitcdc15b48716c51bc0db78524d5df39067437ce21 (patch)
tree1bc536fea36cb5da4d2eb3da7a181068f995aa1f
parentf11bbd3dc5155ed81f632e3c4ab42bbc7c04dda1 (diff)
downloadFreeBSD-src-cdc15b48716c51bc0db78524d5df39067437ce21.zip
FreeBSD-src-cdc15b48716c51bc0db78524d5df39067437ce21.tar.gz
Add ATOMIC_*_LOCK_FREE constants.
These constants are part of the C standard. Both Clang and GCC seem to export these constants under the name __GCC_ATOMIC_*_LOCK_FREE.
-rw-r--r--sys/sys/stdatomic.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h
index ceec160..ac53751 100644
--- a/sys/sys/stdatomic.h
+++ b/sys/sys/stdatomic.h
@@ -46,6 +46,41 @@
#endif
/*
+ * 7.17.1 Atomic lock-free macros.
+ */
+
+#ifdef __GCC_ATOMIC_BOOL_LOCK_FREE
+#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_CHAR_LOCK_FREE
+#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_SHORT_LOCK_FREE
+#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_INT_LOCK_FREE
+#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_LONG_LOCK_FREE
+#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_LLONG_LOCK_FREE
+#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
+#endif
+#ifdef __GCC_ATOMIC_POINTER_LOCK_FREE
+#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
+#endif
+
+/*
* 7.17.2 Initialization.
*/
OpenPOWER on IntegriCloud