Use heap types for builtin wrappers

Closes #3196
This commit is contained in:
William S Fulton 2025-06-20 23:02:24 +01:00
parent cde0447240
commit 2f00a7dc07
3 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.4.0 (in progress)
===========================
2025-06-20: wsfulton
[Python] #3196 Heap types are now generated by default instead of static types
for the builtin wrappers. Defining SWIG_HEAPTYPES to use heap types
is no longer required.
2025-06-18: wsfulton
[Python] #3196 Add support for -builtin and heap types turned on with
-DSWIG_HEAPTYPES. This is an important step towards supporting a number of

View File

@ -1,4 +1,4 @@
#if !defined(SWIGPYTHON_BUILTIN) && PY_VERSION_HEX >= 0x03030000
#if PY_VERSION_HEX >= 0x03030000 && !defined(SWIG_NO_HEAPTYPES)
#if !defined(SWIG_HEAPTYPES)
#define SWIG_HEAPTYPES
#endif

View File

@ -4458,7 +4458,7 @@ public:
printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_clear"), "tp_clear", "inquiry");
printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_richcompare", richcompare_func), "tp_richcompare", "richcmpfunc");
printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_methods", methods_name), "tp_methods");
// printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_members"), "tp_members");
printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_members"), "tp_members");
printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_getset", getset_name), "tp_getset");
printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_hash", tp_hash), "tp_hash", "hashfunc");
printHeapTypesSlot(f, getHeapTypesSlot(n, "feature:python:tp_call"), "tp_call", "ternaryfunc");