[ctypes-commit] ctypes/sandbox/tools/codegen codegenerator.py,1.3,1.4
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2004-12-07 09:38:29
|
Update of /cvsroot/ctypes/ctypes/sandbox/tools/codegen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15593 Modified Files: codegenerator.py Log Message: Output the correct callback type (WINFUNCTYPE or CFUNCTYPE). Index: codegenerator.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/sandbox/tools/codegen/codegenerator.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** codegenerator.py 2 Dec 2004 12:54:50 -0000 1.3 --- codegenerator.py 7 Dec 2004 09:38:19 -0000 1.4 *************** *** 121,126 **** elif isinstance(t, typedesc.FunctionType): args = map(type_name, [t.returns] + t.arguments) ! # WINFUNCTYPE already *is* a pointer to a function! ! return "CFUNCTYPE(%s)" % ", ".join(args) elif isinstance(t, typedesc.CvQualifiedType): return "const(%s)" % type_name(t.typ) --- 121,128 ---- elif isinstance(t, typedesc.FunctionType): args = map(type_name, [t.returns] + t.arguments) ! if "__stdcall__" in t.attributes: ! return "WINFUNCTYPE(%s)" % ", ".join(args) ! else: ! return "CFUNCTYPE(%s)" % ", ".join(args) elif isinstance(t, typedesc.CvQualifiedType): return "const(%s)" % type_name(t.typ) *************** *** 181,184 **** --- 183,187 ---- ws2_32 opengl32 + glu32 mswsock msvcrt *************** *** 369,372 **** --- 372,376 ---- return dll._name ## print >> sys.stderr, "warning: dll not found for function %s" % name + return "???" return None |