summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/forkfd/forkfd_c11.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/forkfd/forkfd_c11.h')
-rw-r--r--src/3rdparty/forkfd/forkfd_c11.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/3rdparty/forkfd/forkfd_c11.h b/src/3rdparty/forkfd/forkfd_c11.h
index f3dc2b5357..934ce55a11 100644
--- a/src/3rdparty/forkfd/forkfd_c11.h
+++ b/src/3rdparty/forkfd/forkfd_c11.h
@@ -36,7 +36,7 @@
# define FFD_ATOMIC_ACQUIRE std::memory_order_acquire
# define FFD_ATOMIC_RELEASE std::memory_order_release
// acq_rel & cst not necessary
-typedef std::atomic_int ffd_atomic_int;
+typedef std::atomic<int> ffd_atomic_int;
#else
# include <stdatomic.h>
# define ffd_atomic_pointer(type) _Atomic(type*)
@@ -48,7 +48,11 @@ typedef std::atomic_int ffd_atomic_int;
typedef atomic_int ffd_atomic_int;
#endif
+#ifdef __cpp_lib_atomic_value_initialization
+#define FFD_ATOMIC_INIT(val) { val }
+#else
#define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val)
+#endif
#define ffd_atomic_load(ptr, order) \
atomic_load_explicit(ptr, order)