Skip to content

Commit

Permalink
Add FFI definitions for Py_EnterRecursiveCall and `Py_LeaveRecursiv…
Browse files Browse the repository at this point in the history
…eCall` (#2511)

* Add FFI definitions for `Py_EnterRecursiveCall` and
`Py_LeaveRecursiveCall`

* Update pyo3-ffi/src/ceval.rs

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
  • Loading branch information
messense and davidhewitt committed Jul 15, 2022
1 parent 5ff494c commit 3c0520d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Supprt `#[pyo3(name)]` on enum variants [#2457](https://github.com/PyO3/pyo3/pull/2457)
- Add `PySuper` object [#2049](https://github.com/PyO3/pyo3/issues/2049)
- Add support for generating PyPy Windows import library. [#2506](https://github.com/PyO3/pyo3/pull/2506)
- Add FFI definitions for `Py_EnterRecursiveCall` and `Py_LeaveRecursiveCall`. [#2511](https://github.com/PyO3/pyo3/pull/2511)

### Changed

Expand Down
10 changes: 8 additions & 2 deletions pyo3-ffi/src/ceval.rs
Expand Up @@ -73,8 +73,14 @@ extern "C" {
fn _Py_CheckRecursiveCall(_where: *mut c_char) -> c_int;
}

// skipped Py_EnterRecursiveCall
// skipped Py_LeaveRecursiveCall
extern "C" {
#[cfg(Py_3_9)]
#[cfg_attr(PyPy, link_name = "PyPy_EnterRecursiveCall")]
pub fn Py_EnterRecursiveCall(arg1: *const c_char);
#[cfg(Py_3_9)]
#[cfg_attr(PyPy, link_name = "PyPy_LeaveRecursiveCall")]
pub fn Py_LeaveRecursiveCall();
}

extern "C" {
pub fn PyEval_GetFuncName(arg1: *mut PyObject) -> *const c_char;
Expand Down

0 comments on commit 3c0520d

Please sign in to comment.