Skip to content

Commit

Permalink
pythongh-121487: Fix deprecation warning for ATOMIC_VAR_INIT in mimal…
Browse files Browse the repository at this point in the history
…loc (pythongh-121488)

(cherry picked from commit 31873be)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
  • Loading branch information
cdce8p authored and miss-islington committed Jul 8, 2024
1 parent 2f8919e commit 9985800
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Include/internal/mimalloc/mimalloc/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ terms of the MIT license. A copy of the license can be found in the file
#define _Atomic(tp) std::atomic<tp>
#define mi_atomic(name) std::atomic_##name
#define mi_memory_order(name) std::memory_order_##name
#if !defined(ATOMIC_VAR_INIT) || (__cplusplus >= 202002L) // c++20, see issue #571
#if (__cplusplus >= 202002L) // c++20, see issue #571
#define MI_ATOMIC_VAR_INIT(x) x
#elif !defined(ATOMIC_VAR_INIT)
#define MI_ATOMIC_VAR_INIT(x) x
#else
#define MI_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x)
Expand All @@ -39,7 +41,9 @@ terms of the MIT license. A copy of the license can be found in the file
#include <stdatomic.h>
#define mi_atomic(name) atomic_##name
#define mi_memory_order(name) memory_order_##name
#if !defined(ATOMIC_VAR_INIT) || (__STDC_VERSION__ >= 201710L) // c17, see issue #735
#if (__STDC_VERSION__ >= 201710L) // c17, see issue #735
#define MI_ATOMIC_VAR_INIT(x) x
#elif !defined(ATOMIC_VAR_INIT)
#define MI_ATOMIC_VAR_INIT(x) x
#else
#define MI_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix deprecation warning for ATOMIC_VAR_INIT in mimalloc.

0 comments on commit 9985800

Please sign in to comment.