[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] SIP beginner question(s) -- how to wrap typedef struct?
From: Robin M Baur <rmb62 () cornell ! edu>
Date: 2011-08-19 14:28:44
Message-ID: CAEyrrV=OX9_QjtsvukdP-4hkVh=FhybGWa2S3+ku7XQNZWKETQ () mail ! gmail ! com
[Download RAW message or body]
Hi list,
I'm just getting started with SIP and have a few questions that I
haven't yet found the answers to in the docs. Pointers back to the
docs are welcome if I've missed something obvious. A standalone
representative snippet of my header file is at the bottom of this
email.
1. Mainly, I'm searching for the correct combination of directives to
wrap a typedef struct statement, assuming that's possible. (Is it?) I
can wrap typedefs and structs individually, but I've been stymied in
the attempt to do both together. I've tried both doing nothing and
putting a %TypeHeaderCode directive inside the struct definition;
either way, SIP just complains of a syntax error on the line with the
opening brace. Should I be looking at %MappedType? Something else?
2. Is %UnitCode the correct directive for wrapping #pragma and
#define? If not, what is?
3. My (Windows) compiler (MSVC 9.0) doesn't balk at UINT32, but SIP
understandably does ("UINT32 is undefined."). MSVC 9 inexplicably
doesn't ship stdint.h, so I can' t pull the obvious trick of
#including stdint.h and replacing UINT32 with uint32_t everywhere.
Does anyone know of a workaround for getting a UINT32 wrapped with
SIP?
Thanks for any advice.
-- Robin
test.h:
---------------------
#pragma once
#define API_OK 0
typedef struct
{
unsigned short port;
UINT32 baud;
} SERIAL_INIT_TS;
typedef struct
{
SERIAL_INIT_TS serialData;
char camConfigFile[MAX_PATH+1];
UINT32 bpp;
} CAMOPEN_PARAM_TS;
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic