]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows (#127994)
authorVictor Stinner <vstinner@python.org>
Mon, 16 Dec 2024 17:17:01 +0000 (18:17 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Dec 2024 17:17:01 +0000 (17:17 +0000)
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

index e3e9cd13594814e2fd38ea31885a9f371c19a616..e0378f9d27a048c26b87fe4b3ae3869aaae5cc9b 100644 (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)