--- PyQt-commercial-3.16/configure.py.win64	2006-06-22 20:48:37.593750000 +0200
+++ PyQt-commercial-3.16/configure.py	2006-06-22 21:00:01.500000000 +0200
@@ -742,6 +742,13 @@
             f.write("-x Qt_%s\n" % feat)
             disabled_classes.append(cname)
 
+    # 64 bit Windows has sizeof(long) < sizeof(void *) 
+    import struct
+    if sys.platform == 'win32' and struct.calcsize('l') < struct.calcsize('P'):
+        pass
+    else:
+        f.write("-x Qt_QLONG_LARGER_THAN_LONG");
+
     f.close()
 
 
--- PyQt-commercial-3.16/sip/qt/qglobal.sip.win64	2006-06-22 20:31:21.812500000 +0200
+++ PyQt-commercial-3.16/sip/qt/qglobal.sip	2006-06-22 20:41:25.375000000 +0200
@@ -36,8 +36,14 @@
 typedef int		Q_INT32;
 typedef unsigned	Q_UINT32;
 
+%If (!Qt_QLONG_LARGER_THAN_LONG)
 typedef long		Q_LONG;
 typedef unsigned long	Q_ULONG;
+%End
+%If (Qt_QLONG_LARGER_THAN_LONG)
+typedef long long          Q_LONG;
+typedef unsigned long long Q_ULONG;
+%End 
 
 const char *qVersion();
 
--- PyQt-commercial-3.16/sip/qt/qiodevice.sip.win64	2006-06-22 20:13:45.734375000 +0200
+++ PyQt-commercial-3.16/sip/qt/qiodevice.sip	2006-06-22 20:45:15.171875000 +0200
@@ -78,7 +78,12 @@
 
 public:
 %If (Qt_3_0_0 -)
-	typedef unsigned long Offset;
+%If (!Qt_QLONG_LARGER_THAN_LONG)
+ 	typedef unsigned long Offset;
+%End
+%If (Qt_QLONG_LARGER_THAN_LONG)
+        typedef unsigned long long Offset;
+%End
 %End
 
 	QIODevice();
@@ -121,7 +126,7 @@
 	bool reset();
 
 %If (- Qt_3_0_0)
-	virtual SIP_PYOBJECT readBlock(uint) = 0 /ReleaseGIL/ [int (char *,uint)];
+	virtual SIP_PYOBJECT readBlock(uint) = 0 /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)];
 %MethodCode
 		char *buf;
 
--- PyQt-commercial-3.16/sip/qt/versions.sip.win64	2006-06-22 20:37:03.093750000 +0200
+++ PyQt-commercial-3.16/sip/qt/versions.sip	2006-06-22 20:39:54.984375000 +0200
@@ -26,6 +26,9 @@
 // Specify the platforms.
 %Platforms	{WS_X11	WS_WIN WS_QWS WS_MACX}
 
+// A WS_WIN64 platform is not really necessary.
+%Feature        Qt_QLONG_LARGER_THAN_LONG
+
 
 // Specify the features.
 %Feature	Qt_THREAD_SUPPORT
