diff Modules/_ctypes/ctypes.h @ 46549:90e2146cb8a3

Merged revisions 62481 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r62481 | thomas.heller | 2008-04-24 20:14:19 +0200 (Do, 24 Apr 2008) | 3 lines Remove cyclic reference in CFuncPtr instances; see issue #2682. Backport candidate for the release25-maint branch. ........
author Thomas Heller <theller@ctypes.org>
date Thu, 24 Apr 2008 18:39:36 +0000
parents 61487be6f442
children 948bea96dd20
line wrap: on
line diff
--- a/Modules/_ctypes/ctypes.h	Thu Apr 24 18:26:53 2008 +0000
+++ b/Modules/_ctypes/ctypes.h	Thu Apr 24 18:39:36 2008 +0000
@@ -53,14 +53,18 @@
 };
 
 typedef struct {
+	PyObject_VAR_HEAD
 	ffi_closure *pcl; /* the C callable */
 	ffi_cif cif;
 	PyObject *converters;
 	PyObject *callable;
+	PyObject *restype;
 	SETFUNC setfunc;
-	ffi_type *restype;
+	ffi_type *ffi_restype;
 	ffi_type *atypes[1];
-} ffi_info;
+} CThunkObject;
+extern PyTypeObject CThunk_Type;
+#define CThunk_CheckExact(v)	    ((v)->ob_type == &CThunk_Type)
 
 typedef struct {
 	/* First part identical to tagCDataObject */
@@ -76,7 +80,7 @@
 	union value b_value;
 	/* end of tagCDataObject, additional fields follow */
 
-	ffi_info *thunk;
+	CThunkObject *thunk;
 	PyObject *callable;
 
 	/* These two fields will override the ones in the type's stgdict if
@@ -147,10 +151,10 @@
 
 extern PyMethodDef module_methods[];
 
-extern ffi_info *AllocFunctionCallback(PyObject *callable,
-				       PyObject *converters,
-				       PyObject *restype,
-				       int stdcall);
+extern CThunkObject *AllocFunctionCallback(PyObject *callable,
+					   PyObject *converters,
+					   PyObject *restype,
+					   int stdcall);
 /* a table entry describing a predefined ctypes type */
 struct fielddesc {
 	char code;