Skip to content

Commit 9660827

Browse files
committed
fix structmember.h defines in cython 3
1 parent eaae799 commit 9660827

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/sage/libs/gap/gap_includes.pxd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,18 @@ cdef extern from "gap/stringobj.h" nogil:
144144
bint IS_STRING(Obj obj)
145145
bint IsStringConv(Obj obj)
146146
Obj NEW_STRING(Int)
147+
148+
149+
cdef extern from "<structmember.h>" nogil:
150+
"""
151+
/* Hack: Cython 3.0 automatically includes <structmember.h>, which
152+
* defines several macros that collides with enum definitions in
153+
* gap/objects.h. We need to include the header explicitly and
154+
* undefine these macros.
155+
*/
156+
#undef T_INT
157+
#undef T_STRING
158+
#undef T_CHAR
159+
#undef T_BOOL
160+
"""
161+
pass

0 commit comments

Comments
 (0)