[Python-checkins] r84846 - in python/branches/release27-maint: Modules/_ctypes/callbacks.c Modules/_ctypes/libffi_osx/include/ffi.h Modules/_ctypes/malloc_closure.c setup.py
ronald.oussoren
python-checkins at python.org
Thu Sep 16 13:35:07 CEST 2010
Author: ronald.oussoren
Date: Thu Sep 16 13:35:07 2010
New Revision: 84846
Log:
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.
........
Modified:
python/branches/release27-maint/ (props changed)
python/branches/release27-maint/Modules/_ctypes/callbacks.c
python/branches/release27-maint/Modules/_ctypes/libffi_osx/include/ffi.h
python/branches/release27-maint/Modules/_ctypes/malloc_closure.c
python/branches/release27-maint/setup.py
Modified: python/branches/release27-maint/Modules/_ctypes/callbacks.c
==============================================================================
--- python/branches/release27-maint/Modules/_ctypes/callbacks.c (original)
+++ python/branches/release27-maint/Modules/_ctypes/callbacks.c Thu Sep 16 13:35:07 2010
@@ -469,9 +469,13 @@
"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);
Modified: python/branches/release27-maint/Modules/_ctypes/libffi_osx/include/ffi.h
==============================================================================
--- python/branches/release27-maint/Modules/_ctypes/libffi_osx/include/ffi.h (original)
+++ python/branches/release27-maint/Modules/_ctypes/libffi_osx/include/ffi.h Thu Sep 16 13:35:07 2010
@@ -264,6 +264,9 @@
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 @@
}
#endif
-#endif // #ifndef LIBFFI_H
\ No newline at end of file
+#endif // #ifndef LIBFFI_H
Modified: python/branches/release27-maint/Modules/_ctypes/malloc_closure.c
==============================================================================
--- python/branches/release27-maint/Modules/_ctypes/malloc_closure.c (original)
+++ python/branches/release27-maint/Modules/_ctypes/malloc_closure.c Thu Sep 16 13:35:07 2010
@@ -110,7 +110,6 @@
return NULL;
item = free_list;
free_list = item->next;
- *codeloc = (void *)item;
+ *codeloc = (void *)item;
return (void *)item;
}
-
Modified: python/branches/release27-maint/setup.py
==============================================================================
--- python/branches/release27-maint/setup.py (original)
+++ python/branches/release27-maint/setup.py Thu Sep 16 13:35:07 2010
@@ -1875,6 +1875,7 @@
depends = ['_ctypes/ctypes.h']
if sys.platform == 'darwin':
+ sources.append('_ctypes/malloc_closure.c')
sources.append('_ctypes/darwin/dlfcn_simple.c')
extra_compile_args.append('-DMACOSX')
include_dirs.append('_ctypes/darwin')
More information about the Python-checkins
mailing list