Skip to content

Commit 4524786

Browse files
authored
[3.14] gh-160208: Fix PyObject structure on C++ (#160562)
On C++, use __extension__ on the anonymous union even if the __STDC_VERSION__ macro is defined to C11 or newer (which is the case on OpenIndiana).
1 parent c1df9cf commit 4524786

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)