Commit 814bfa23 authored by Witold Krecicki's avatar Witold Krecicki Committed by Witold Krecicki

Add atomic_store_relaxed and atomic_load_relaxed macros to isc/atomic.h, fix...

Add atomic_store_relaxed and atomic_load_relaxed macros to isc/atomic.h, fix issues in isc/stdatomic.h
parent 9a2d889c
......@@ -16,3 +16,12 @@
#else
#include <isc/stdatomic.h>
#endif
/*
* We define a few additional macros to make things easier
*/
#define atomic_store_relaxed(o, v) atomic_store_explicit((o), \
(v), \
memory_order_relaxed)
#define atomic_load_relaxed(o) atomic_load_explicit((o), memory_order_relaxed)
......@@ -11,6 +11,8 @@
#pragma once
#include <inttypes.h>
#if !defined(__has_feature)
#define __has_feature(x) 0
#endif
......@@ -134,11 +136,11 @@ typedef uint_fast64_t atomic_uint_fast64_t;
#define atomic_load(obj) \
atomic_load_explicit(obj, memory_order_seq_cst)
#define atomic_store(obj) \
atomic_store_explicit(obj, memory_order_seq_cst)
#define atomic_fetch_add(obj) \
#define atomic_store(obj, arg) \
atomic_store_explicit(obj, arg, memory_order_seq_cst)
#define atomic_fetch_add(obj, arg) \
atomic_fetch_add_explicit(obj, arg, memory_order_seq_cst)
#define atomic_fetch_sub(obj) \
#define atomic_fetch_sub(obj, arg) \
atomic_fetch_sub_explicit(obj, arg, memory_order_seq_cst)
#define atomic_compare_exchange_strong(obj, expected, desired) \
atomic_compare_exchange_strong_explicit(obj, expected, desired, memory_order_seq_cst, memory_order_seq_cst)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment