]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-144490: Fix mimalloc debug build for C++ (#144620)
authorAlper <alperyoney@fb.com>
Tue, 10 Feb 2026 10:56:52 +0000 (02:56 -0800)
committerGitHub <noreply@github.com>
Tue, 10 Feb 2026 10:56:52 +0000 (11:56 +0100)
Include/internal/mimalloc/mimalloc/types.h
Lib/test/test_cppext/extension.cpp

index 19e9322417431418747e420c3ee52fbce6908711..286e7bf668312dbf53e772e4248159fe48a2fdd6 100644 (file)
@@ -608,8 +608,8 @@ struct mi_heap_s {
 
 #if (MI_DEBUG)
 // use our own assertion to print without memory allocation
-mi_decl_noreturn mi_decl_cold mi_decl_throw
-void _mi_assert_fail(const char* assertion, const char* fname, unsigned int line, const char* func);
+mi_decl_noreturn mi_decl_cold
+void _mi_assert_fail(const char* assertion, const char* fname, unsigned int line, const char* func) mi_decl_throw;
 #define mi_assert(expr)     ((expr) ? (void)0 : _mi_assert_fail(#expr,__FILE__,__LINE__,__func__))
 #else
 #define mi_assert(x)
index a8cd70aacbc805a6ba7ddcd38530c154316cbd15..b631ddad7201f03d1fd363c5e7fe6d06f804d0cc 100644 (file)
 #ifdef TEST_INTERNAL_C_API
    // gh-135906: Check for compiler warnings in the internal C API
 #  include "internal/pycore_frame.h"
-   // mimalloc emits many compiler warnings when Python is built in debug
-   // mode (when MI_DEBUG is not zero).
    // mimalloc emits compiler warnings when Python is built on Windows.
-#  if !defined(Py_DEBUG) && !defined(MS_WINDOWS)
+#  if !defined(MS_WINDOWS)
 #    include "internal/pycore_backoff.h"
 #    include "internal/pycore_cell.h"
 #  endif