5b92700545031de4bb0ad6fe473df089e70ffe45
1 // SPDX-FileCopyrightText: 2023 Olivier Dion <odion@efficios.com>
3 // SPDX-License-Identifier: LGPL-2.1-or-later
6 * urcu/uatomic/builtins.h
9 #ifndef _URCU_UATOMIC_BUILTINS_H
10 #define _URCU_UATOMIC_BUILTINS_H
12 #include <urcu/arch.h>
14 #if defined(__has_builtin)
15 # if !__has_builtin(__atomic_store_n)
16 # error "Toolchain does not support __atomic_store_n."
18 # if !__has_builtin(__atomic_load_n)
19 # error "Toolchain does not support __atomic_load_n."
21 # if !__has_builtin(__atomic_exchange_n)
22 # error "Toolchain does not support __atomic_exchange_n."
24 # if !__has_builtin(__atomic_compare_exchange_n)
25 # error "Toolchain does not support __atomic_compare_exchange_n."
27 # if !__has_builtin(__atomic_add_fetch)
28 # error "Toolchain does not support __atomic_add_fetch."
30 # if !__has_builtin(__atomic_sub_fetch)
31 # error "Toolchain does not support __atomic_sub_fetch."
33 # if !__has_builtin(__atomic_or_fetch)
34 # error "Toolchain does not support __atomic_or_fetch."
36 # if !__has_builtin(__atomic_thread_fence)
37 # error "Toolchain does not support __atomic_thread_fence."
39 # if !__has_builtin(__atomic_signal_fence)
40 # error "Toolchain does not support __atomic_signal_fence."
42 #elif defined(__GNUC__)
43 # define GCC_VERSION (__GNUC__ * 10000 + \
44 __GNUC_MINOR__ * 100 + \
46 # if GCC_VERSION < 40700
47 # error "GCC version is too old. Version must be 4.7 or greater"
51 # error "Toolchain is not supported."
55 # define UATOMIC_HAS_ATOMIC_BYTE __GCC_ATOMIC_CHAR_LOCK_FREE
56 # define UATOMIC_HAS_ATOMIC_SHORT __GCC_ATOMIC_SHORT_LOCK_FREE
57 #elif defined(__clang__)
58 # define UATOMIC_HAS_ATOMIC_BYTE __CLANG_ATOMIC_CHAR_LOCK_FREE
59 # define UATOMIC_HAS_ATOMIC_SHORT __CLANG_ATOMIC_SHORT_LOCK_FREE
61 /* # define UATOMIC_HAS_ATOMIC_BYTE */
62 /* # define UATOMIC_HAS_ATOMIC_SHORT */
65 #include <urcu/uatomic/builtins-generic.h>
67 #endif /* _URCU_UATOMIC_BUILTINS_H */
This page took 0.031326 seconds and 5 git commands to generate.