Skip to content

Commit 31873be

Browse files
authored
gh-121487: Fix deprecation warning for ATOMIC_VAR_INIT in mimalloc (gh-121488)
1 parent db00fee commit 31873be

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Include/internal/mimalloc/mimalloc/atomic.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ terms of the MIT license. A copy of the license can be found in the file
2323
#define _Atomic(tp) std::atomic<tp>
2424
#define mi_atomic(name) std::atomic_##name
2525
#define mi_memory_order(name) std::memory_order_##name
26-
#if !defined(ATOMIC_VAR_INIT) || (__cplusplus >= 202002L) // c++20, see issue #571
26+
#if (__cplusplus >= 202002L) // c++20, see issue #571
27+
#define MI_ATOMIC_VAR_INIT(x) x
28+
#elif !defined(ATOMIC_VAR_INIT)
2729
#define MI_ATOMIC_VAR_INIT(x) x
2830
#else
2931
#define MI_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x)
@@ -39,7 +41,9 @@ terms of the MIT license. A copy of the license can be found in the file
3941
#include <stdatomic.h>
4042
#define mi_atomic(name) atomic_##name
4143
#define mi_memory_order(name) memory_order_##name
42-
#if !defined(ATOMIC_VAR_INIT) || (__STDC_VERSION__ >= 201710L) // c17, see issue #735
44+
#if (__STDC_VERSION__ >= 201710L) // c17, see issue #735
45+
#define MI_ATOMIC_VAR_INIT(x) x
46+
#elif !defined(ATOMIC_VAR_INIT)
4347
#define MI_ATOMIC_VAR_INIT(x) x
4448
#else
4549
#define MI_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix deprecation warning for ATOMIC_VAR_INIT in mimalloc.

0 commit comments

Comments
 (0)