[PySide] [Stackless] PySide problem, take #2: typeobject clash

John Ehresman jpe at wingware.com
Tue Oct 22 16:24:56 CEST 2013

> On 21.10.13 22:10, John Ehresman wrote:
>> I think I see the problem; to me, at least, it's useful to see the
>> stackless version of object.h at
>> http://www.stackless.com/browser/Include/object.h  It looks like
>> stackless moves the fields defined in PyHeapTypeObject into
>> PyTypeObject, adds at least one additional field, and then #define's
>> PyHeapTypeObject to PyTypeObject.  This leads to two problems, which
>> are somewhat separable --
>> 1) When compiling, there is no ht_type field in PyHeapTypeObject. This
>> is what Christian's patch addresses.

Wouldn't it be possible to use something like the following in 
shiboken's basewrapper.h (untested code below):

/// PyTypeObject extended with C++ multiple inheritance information.

struct LIBSHIBOKEN_API SbkObjectType
     PyHeapTypeObject super;
     SbkObjectTypePrivate* d;

#else // STACKLESS

// Work around stackless's modification of PyTypeObject and PyHeapTypeObject
struct LIBSHIBOKEN_API SbkObjectType
     struct {
         PyTypeObject ht_type;
     } super;
     SbkObjectTypePrivate* d;


This would have the advantage of not sprinkling macros across the code 
base.  It does not address the binary compatibility problem.



More information about the PySide mailing list