[PyQt] precompiled header to define a variable type which is primitive

Phil Thompson phil at riverbankcomputing.com
Sun Jun 6 12:26:54 BST 2010


On Thu, 03 Jun 2010 16:23:59 -0400, Blaine Bell
<blaine.bell at schrodinger.com> wrote:
> I have a variable uint64 that I want to use in a SIP file for arguments, 
> return values, and parts of MappedTypes (i.e., types such as 
> std::map<QString,uint64> which are used in functions).  This variable 
> uint64 is defined differently on platforms in a header:
> 
> #if defined(WIN32) && defined(_MSC_VER) && _MSC_VER <= 1310
> typedef unsigned __int64 uint64;
> #else
> typedef unsigned long long uint64;
> #endif
> 
> How should I go about implementing this?  I have tried to include this 
> header in the %ModuleCode block, but it didn't work with the sip 
> declarations.  I have a feeling that I need to define a %MappedType 
> uint64, but when I do this, I run into other issues (for example in my 
> vector template, since I use uint64, handling entries, in this case the 
> entries are not sipClass_, but sipType_).  Do I need to implement a 
> vector template for objects and primitive values?  Or is there another 
> way I can get away with implementing uint64?

For that particular case you should just be able to use...

typedef unsigned long long uint64;

Internally SIP will use the PY_LONG_LONG macro provided by Python to do the
right thing.

Phil


More information about the PyQt mailing list