… | |
… | |
107 | /* not just C11 atomics and atomic accesses */ |
107 | /* not just C11 atomics and atomic accesses */ |
108 | #include <stdatomic.h> |
108 | #include <stdatomic.h> |
109 | #define ECB_MEMORY_FENCE atomic_thread_fence (memory_order_acq_rel) |
109 | #define ECB_MEMORY_FENCE atomic_thread_fence (memory_order_acq_rel) |
110 | #define ECB_MEMORY_FENCE_ACQUIRE atomic_thread_fence (memory_order_acquire) |
110 | #define ECB_MEMORY_FENCE_ACQUIRE atomic_thread_fence (memory_order_acquire) |
111 | #define ECB_MEMORY_FENCE_RELEASE atomic_thread_fence (memory_order_release) |
111 | #define ECB_MEMORY_FENCE_RELEASE atomic_thread_fence (memory_order_release) |
|
|
112 | #endif |
|
|
113 | #endif |
|
|
114 | |
|
|
115 | #ifndef ECB_MEMORY_FENCE_RELEASE |
|
|
116 | #if ECB_GCC_VERSION(4,7) |
|
|
117 | #define ECB_MEMORY_FENCE __atomic_thread_fence (__ATOMIC_ACQ_REL) |
|
|
118 | #define ECB_MEMORY_FENCE_ACQUIRE __atomic_thread_fence (__ATOMIC_ACQUIRE) |
|
|
119 | #define ECB_MEMORY_FENCE_RELEASE __atomic_thread_fence (__ATOMIC_RELEASE) |
112 | #endif |
120 | #endif |
113 | #endif |
121 | #endif |
114 | |
122 | |
115 | #ifndef ECB_MEMORY_FENCE |
123 | #ifndef ECB_MEMORY_FENCE |
116 | #if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110 |
124 | #if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110 |