[PyQt] SIP snapshots do not handle typedef as SIP-4.7.7

Gerard Vermeulen gav451 at gmail.com
Mon Oct 27 05:14:13 GMT 2008


Hi,

I have .sip files like :

class TripleField
{

%TypeHeaderCode
#include <qwt3d_types.h>
#include <sip_Qwt3DTriple.h>
using namespace Qwt3D;
%End // %TypeHeaderCode

public:
    TripleField();
    TripleField(size_type);
    TripleField(size_type, const Triple &);
    TripleField(const TripleField &);

    size_type capacity() const;
...
}; // class TripleField

and size_type defined in a .sip file like:

// Automagically generated by configure.py

// Uncomment one of the following three lines
// typedef unsigned int size_type;
typedef unsigned long size_type;
// typedef unsigned long long size_type;

The code generated by the latest SIP snapshots lead to
compilation errors:

sip_Qwt3Dpart1.cpp: In function ‘PyObject*
meth_TripleField_capacity(PyObject*, PyObject*)’:
sip_Qwt3Dpart1.cpp:9604: error: ‘size_type’ was not declared in this
scope
sip_Qwt3Dpart1.cpp:9604: error: expected `;' before ‘sipRes’

I have to add a line
typedef size_t size_type;
in the TypeHeaderCode above to make it compile.

Is this a bug or a feature?

Gerard







More information about the PyQt mailing list