summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-08-31 13:06:44 (GMT)
committerThomas Heller <theller@ctypes.org>2007-08-31 13:06:44 (GMT)
commit674e9389e9fdadd622829f4833367ac3b38475b5 (patch)
tree571bc2fb76b095b091ffcf0cdab476a20052a02d /Lib/ctypes
parentc5a6a3078b3939beb3d8f592d2e306b6039940ad (diff)
downloadcpython-674e9389e9fdadd622829f4833367ac3b38475b5.zip
cpython-674e9389e9fdadd622829f4833367ac3b38475b5.tar.gz
cpython-674e9389e9fdadd622829f4833367ac3b38475b5.tar.bz2
Add a workaround for a strange bug on win64, when _ctypes is compiled
with the SDK compiler. This should fix the failing Lib\ctypes\test\test_as_parameter.py test.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index cdf6d36..f55d194 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -535,3 +535,9 @@ for kind in [c_ushort, c_uint, c_ulong, c_ulonglong]:
elif sizeof(kind) == 4: c_uint32 = kind
elif sizeof(kind) == 8: c_uint64 = kind
del(kind)
+
+# XXX for whatever reasons, creating the first instance of a callback
+# function is needed for the unittests on Win64 to succeed. This MAY
+# be a compiler bug, since the problem occurs only when _ctypes is
+# compiled with the MS SDK compiler. Or an uninitialized variable?
+CFUNCTYPE(c_int)(lambda: None)