Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9dc4e927
Commit
9dc4e927
authored
Sep 05, 2010
by
Ronald Oussoren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issue9662, patch by Łukasz Langa in issue5504.
parent
35161d59
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
Modules/_ctypes/callbacks.c
Modules/_ctypes/callbacks.c
+4
-0
Modules/_ctypes/libffi_osx/include/ffi.h
Modules/_ctypes/libffi_osx/include/ffi.h
+4
-1
Modules/_ctypes/malloc_closure.c
Modules/_ctypes/malloc_closure.c
+1
-2
setup.py
setup.py
+1
-0
No files found.
Modules/_ctypes/callbacks.c
View file @
9dc4e927
...
@@ -416,9 +416,13 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
...
@@ -416,9 +416,13 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
"ffi_prep_cif failed with %d"
,
result
);
"ffi_prep_cif failed with %d"
,
result
);
goto
error
;
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
,
result
=
ffi_prep_closure_loc
(
p
->
pcl_write
,
&
p
->
cif
,
closure_fcn
,
p
,
p
,
p
->
pcl_exec
);
p
->
pcl_exec
);
#endif
if
(
result
!=
FFI_OK
)
{
if
(
result
!=
FFI_OK
)
{
PyErr_Format
(
PyExc_RuntimeError
,
PyErr_Format
(
PyExc_RuntimeError
,
"ffi_prep_closure failed with %d"
,
result
);
"ffi_prep_closure failed with %d"
,
result
);
...
...
Modules/_ctypes/libffi_osx/include/ffi.h
View file @
9dc4e927
...
@@ -264,6 +264,9 @@ ffi_prep_closure(
...
@@ -264,6 +264,9 @@ ffi_prep_closure(
void
(
*
fun
)(
ffi_cif
*
,
void
*
,
void
**
,
void
*
),
void
(
*
fun
)(
ffi_cif
*
,
void
*
,
void
**
,
void
*
),
void
*
user_data
);
void
*
user_data
);
void
ffi_closure_free
(
void
*
);
void
*
ffi_closure_alloc
(
size_t
size
,
void
**
code
);
typedef
struct
ffi_raw_closure
{
typedef
struct
ffi_raw_closure
{
char
tramp
[
FFI_TRAMPOLINE_SIZE
];
char
tramp
[
FFI_TRAMPOLINE_SIZE
];
ffi_cif
*
cif
;
ffi_cif
*
cif
;
...
@@ -349,4 +352,4 @@ ffi_call(
...
@@ -349,4 +352,4 @@ ffi_call(
}
}
#endif
#endif
#endif // #ifndef LIBFFI_H
#endif // #ifndef LIBFFI_H
\ No newline at end of file
Modules/_ctypes/malloc_closure.c
View file @
9dc4e927
...
@@ -106,7 +106,6 @@ void *ffi_closure_alloc(size_t ignored, void** codeloc)
...
@@ -106,7 +106,6 @@ void *ffi_closure_alloc(size_t ignored, void** codeloc)
return
NULL
;
return
NULL
;
item
=
free_list
;
item
=
free_list
;
free_list
=
item
->
next
;
free_list
=
item
->
next
;
*
codeloc
=
(
void
*
)
item
;
*
codeloc
=
(
void
*
)
item
;
return
(
void
*
)
item
;
return
(
void
*
)
item
;
}
}
setup.py
View file @
9dc4e927
...
@@ -1657,6 +1657,7 @@ class PyBuildExt(build_ext):
...
@@ -1657,6 +1657,7 @@ class PyBuildExt(build_ext):
depends
=
[
'_ctypes/ctypes.h'
]
depends
=
[
'_ctypes/ctypes.h'
]
if
sys
.
platform
==
'darwin'
:
if
sys
.
platform
==
'darwin'
:
sources
.
append
(
'_ctypes/malloc_closure.c'
)
sources
.
append
(
'_ctypes/darwin/dlfcn_simple.c'
)
sources
.
append
(
'_ctypes/darwin/dlfcn_simple.c'
)
extra_compile_args
.
append
(
'-DMACOSX'
)
extra_compile_args
.
append
(
'-DMACOSX'
)
include_dirs
.
append
(
'_ctypes/darwin'
)
include_dirs
.
append
(
'_ctypes/darwin'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment