From 9c0983975147c64a89f6dabba61ca9708a4b83fb Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 16 Dec 2024 17:52:20 +0100 Subject: [PATCH] gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a compiler warning about an unnamed structure. --- Include/pymacro.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/pymacro.h b/Include/pymacro.h index e3e9cd13594814..e0378f9d27a048 100644 --- a/Include/pymacro.h +++ b/Include/pymacro.h @@ -47,7 +47,7 @@ #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ - && !defined(__cplusplus)) + && !defined(__cplusplus) && !defined(_MSC_VER)) # define Py_BUILD_ASSERT_EXPR(cond) \ ((void)sizeof(struct { int dummy; _Static_assert(cond, #cond); }), \ 0)