summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-09-16 11:35:07 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-09-16 11:35:07 (GMT)
commit30a171fcb6ae70a98a6366c401e494ecc44ee2d8 (patch)
tree3a9f7e2acfe1303df8426a6157575d206e2155d9 /Modules
parent19f9810a1a17830d7cc88ec0788d9a1909c8b5ad (diff)
downloadcpython-30a171fcb6ae70a98a6366c401e494ecc44ee2d8.zip
cpython-30a171fcb6ae70a98a6366c401e494ecc44ee2d8.tar.gz
cpython-30a171fcb6ae70a98a6366c401e494ecc44ee2d8.tar.bz2
Merged revisions 84535 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84535 | ronald.oussoren | 2010-09-05 20:25:59 +0200 (Sun, 05 Sep 2010) | 2 lines Fix for issue9662, patch by Ɓukasz Langa in issue5504. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/callbacks.c4
-rw-r--r--Modules/_ctypes/libffi_osx/include/ffi.h5
-rw-r--r--Modules/_ctypes/malloc_closure.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index deedaa3..716a02f 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -469,9 +469,13 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
"ffi_prep_cif failed with %d", result);
goto error;
}
+#if defined(X86_DARWIN) || defined(POWERPC_DARWIN)
+ result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
+#else
result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
p,
p->pcl_exec);
+#endif
if (result != FFI_OK) {
PyErr_Format(PyExc_RuntimeError,
"ffi_prep_closure failed with %d", result);
diff --git a/Modules/_ctypes/libffi_osx/include/ffi.h b/Modules/_ctypes/libffi_osx/include/ffi.h
index 3d39064..c104a5c 100644
--- a/Modules/_ctypes/libffi_osx/include/ffi.h
+++ b/Modules/_ctypes/libffi_osx/include/ffi.h
@@ -264,6 +264,9 @@ ffi_prep_closure(
void (*fun)(ffi_cif*,void*,void**,void*),
void* user_data);
+void ffi_closure_free(void *);
+void *ffi_closure_alloc (size_t size, void **code);
+
typedef struct ffi_raw_closure {
char tramp[FFI_TRAMPOLINE_SIZE];
ffi_cif* cif;
@@ -349,4 +352,4 @@ ffi_call(
}
#endif
-#endif // #ifndef LIBFFI_H \ No newline at end of file
+#endif // #ifndef LIBFFI_H
diff --git a/Modules/_ctypes/malloc_closure.c b/Modules/_ctypes/malloc_closure.c
index d0a20b5..b98d43b 100644
--- a/Modules/_ctypes/malloc_closure.c
+++ b/Modules/_ctypes/malloc_closure.c
@@ -110,7 +110,6 @@ void *ffi_closure_alloc(size_t ignored, void** codeloc)
return NULL;
item = free_list;
free_list = item->next;
- *codeloc = (void *)item;
+ *codeloc = (void *)item;
return (void *)item;
}
-