]> granicus.if.org Git - python/commitdiff
Backport from py3k branch:
authorThomas Heller <theller@ctypes.org>
Fri, 7 Sep 2007 09:33:24 +0000 (09:33 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 7 Sep 2007 09:33:24 +0000 (09:33 +0000)
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.

Lib/ctypes/__init__.py

index 3ad3161dd90165875668676ec2dfbd088c5d582c..2e35307b5c8c00ee3be658ae35930d828dd6e9de 100644 (file)
@@ -545,3 +545,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)