[pyglet] push by r1chardj0n3s - replace unportable (across Python implementations) test with more expl... on 2013-01-06 23:18 GMT

5 views
Skip to first unread message

pyg...@googlecode.com

unread,
Jan 6, 2013, 6:18:57 PM1/6/13
to pyglet-...@googlegroups.com
Revision: 078133f990a0
Branch: default
Author: Richard Jones <ric...@mechanicalcat.net>
Date: Sun Jan 6 15:18:42 2013
Log: replace unportable (across Python implementations) test with more
explicit one; thanks anatoly
http://code.google.com/p/pyglet/source/detail?r=078133f990a0

Modified:
/pyglet/libs/win32/__init__.py

=======================================
--- /pyglet/libs/win32/__init__.py Sun Jun 10 04:13:07 2012
+++ /pyglet/libs/win32/__init__.py Sun Jan 6 15:18:42 2013
@@ -1,12 +1,15 @@
#!/usr/bin/python
# $Id: $

+import struct
from ctypes import *

import pyglet
import constants
from types import *

+IS64 = struct.calcsize("P") == 8
+
_debug_win32 = pyglet.options['debug_win32']

if _debug_win32:
@@ -189,7 +192,7 @@
_user32.SetCapture.argtypes = [HWND]
_user32.SetClassLongW.restype = DWORD
_user32.SetClassLongW.argtypes = [HWND, c_int, LONG]
-if tuple.__itemsize__ == 8:
+if IS64:
_user32.SetClassLongPtrW.restype = ULONG
_user32.SetClassLongPtrW.argtypes = [HWND, c_int, LONG_PTR]
else:
Reply all
Reply to author
Forward
0 new messages