Changeset 585 for openmoko/trunk/openmoko-target/dev-lang/python/files/python-2.5.4-enable-ctypes-module.patch
- Timestamp:
- 07/02/09 18:31:01 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
openmoko/trunk/openmoko-target/dev-lang/python/files/python-2.5.4-enable-ctypes-module.patch
r335 r585 37 37 } ITEM; 38 38 39 --- Modules/_ctypes/callbacks.c 2008-04-25 19:55:19.000000000 +0000 40 +++ Modules/_ctypes/callbacks.c.new 2009-04-19 18:22:59.000000000 +0000 39 --- Modules/_ctypes/ctypes.h 2009-04-19 18:35:49.000000000 +0000 40 +++ Modules/_ctypes/ctypes.h.new 2009-04-19 18:36:34.000000000 +0000 41 @@ -69,7 +69,9 @@ 42 43 typedef struct { 44 PyObject_VAR_HEAD 45 +#if FFI_CLOSURES 46 ffi_closure *pcl; /* the C callable */ 47 +#endif 48 ffi_cif cif; 49 PyObject *converters; 50 PyObject *callable; 51 --- Modules/_ctypes/callbacks.c 2009-07-02 14:23:24.000000000 +0200 52 +++ Modules/_ctypes/callbacks.c.new 2009-07-02 14:21:05.000000000 +0200 41 53 @@ -20,8 +20,10 @@ 42 54 Py_XDECREF(self->converters); … … 50 62 } 51 63 52 @@ -365,12 +367,13 @@ 64 @@ -336,7 +338,9 @@ 65 return NULL; 66 } 67 68 +#if FFI_CLOSURES 69 p->pcl = NULL; 70 +#endif 71 memset(&p->cif, 0, sizeof(p->cif)); 72 p->converters = NULL; 73 p->callable = NULL; 74 @@ -365,12 +369,13 @@ 53 75 54 76 assert(CThunk_CheckExact(p)); … … 65 87 PyObject *cnv = PySequence_GetItem(converters, i); 66 88 if (cnv == NULL) 67 @@ -409,13 +41 2,14 @@89 @@ -409,13 +414,14 @@ 68 90 "ffi_prep_cif failed with %d", result); 69 91 goto error; … … 81 103 p->converters = converters; 82 104 Py_INCREF(callable); 83 --- Modules/_ctypes/ctypes.h 2009-04-19 18:35:49.000000000 +0000 84 +++ Modules/_ctypes/ctypes.h.new 2009-04-19 18:36:34.000000000 +0000 85 @@ -69,7 +69,9 @@ 105 --- Modules/_ctypes/_ctypes.c 2008-10-18 23:33:44.000000000 +0200 106 +++ Modules/_ctypes/_ctypes.c.new 2009-07-02 14:28:31.000000000 +0200 107 @@ -2952,7 +2952,11 @@ 108 self->callable = callable; 86 109 87 typedef struct { 88 PyObject_VAR_HEAD 110 self->thunk = thunk; 89 111 +#if FFI_CLOSURES 90 ffi_closure *pcl; /* the C callable */ 112 *(void **)self->b_ptr = (void *)thunk->pcl; 113 +#else 114 + *(void **)self->b_ptr = NULL; 91 115 +#endif 92 ffi_cif cif;93 Py Object *converters;94 PyObject *callable;116 117 Py_INCREF((PyObject *)thunk); /* for KeepRef */ 118 if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
