Show
Ignore:
Timestamp:
07/02/09 18:31:01 (3 years ago)
Author:
sleipnir
Message:

Make the _ctypes module compile again for python-2.5.4.

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  
    3737 } ITEM; 
    3838  
    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 
    4153@@ -20,8 +20,10 @@ 
    4254        Py_XDECREF(self->converters); 
     
    5062 } 
    5163  
    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 @@ 
    5375  
    5476        assert(CThunk_CheckExact(p)); 
     
    6587                PyObject *cnv = PySequence_GetItem(converters, i); 
    6688                if (cnv == NULL) 
    67 @@ -409,13 +412,14 @@ 
     89@@ -409,13 +414,14 @@ 
    6890                             "ffi_prep_cif failed with %d", result); 
    6991                goto error; 
     
    81103        p->converters = converters; 
    82104        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; 
    86109  
    87  typedef struct { 
    88         PyObject_VAR_HEAD 
     110        self->thunk = thunk; 
    89111+#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; 
    91115+#endif 
    92         ffi_cif cif; 
    93         PyObject *converters; 
    94         PyObject *callable; 
     116         
     117        Py_INCREF((PyObject *)thunk); /* for KeepRef */ 
     118        if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {