]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121487: Fix deprecation warning for ATOMIC_VAR_INIT in mimalloc (gh-121488)
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>
Mon, 8 Jul 2024 18:32:30 +0000 (20:32 +0200)
committerGitHub <noreply@github.com>
Mon, 8 Jul 2024 18:32:30 +0000 (14:32 -0400)
Include/internal/mimalloc/mimalloc/atomic.h
Misc/NEWS.d/next/Build/2024-07-08-14-01-17.gh-issue-121487.ekHmpR.rst [new file with mode: 0644]

index 52f82487685cdbd5a2575c300077e97a2134c8fa..cdd9c372beafd52cc4b155aef5d56b5b4e01bae2 100644 (file)
@@ -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)
@@ -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)
diff --git a/Misc/NEWS.d/next/Build/2024-07-08-14-01-17.gh-issue-121487.ekHmpR.rst b/Misc/NEWS.d/next/Build/2024-07-08-14-01-17.gh-issue-121487.ekHmpR.rst
new file mode 100644 (file)
index 0000000..e30d4dc
--- /dev/null
@@ -0,0 +1 @@
+Fix deprecation warning for ATOMIC_VAR_INIT in mimalloc.