[3.13] gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows (#127994)

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.
This commit is contained in:
Victor Stinner 2024-12-16 18:17:01 +01:00 committed by GitHub
parent 89f4b23f9e
commit 8e143b2886
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)