Skip to content

Commit 53a004c

Browse files
committed
gh-160208: Fix PyObject structure on C++
Use __extension__ on the anonymous union.
1 parent cd04626 commit 53a004c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Include/object.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ whose size is determined when the object is allocated.
109109
#ifndef Py_GIL_DISABLED
110110
struct _object {
111111
#if (defined(__GNUC__) || defined(__clang__)) \
112-
&& !(defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)
112+
&& (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L \
113+
|| defined(__cplusplus))
113114
// On C99 and older, anonymous union is a GCC and clang extension
114115
__extension__
115116
#endif

0 commit comments

Comments
 (0)