Skip to content

Commit b2163a0

Browse files
ngoldbaumbschoenmaeckersdavidhewitt
authored
Fix Py_UNICODE_TODECIMAL definition for PyPy (#6078)
* Fix Py_UNICODE_TODECIMAL definition for PyPy * Update unicodeobject.rs Co-authored-by: Bas Schoenmaeckers <7943856+bschoenmaeckers@users.noreply.github.com> --------- Co-authored-by: Bas Schoenmaeckers <7943856+bschoenmaeckers@users.noreply.github.com> Co-authored-by: David Hewitt <mail@davidhewitt.dev>
1 parent 30c8b24 commit b2163a0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pyo3-ffi/src/cpython/unicodeobject.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ extern_libpython! {
837837
// skipped _PyUnicode_ToUppercase
838838
// skipped _PyUnicode_ToTitlecase
839839

840+
#[cfg(not(PyPy))]
840841
fn _PyUnicode_ToDecimalDigit(ch: Py_UCS4) -> c_int;
841842

842843
// skipped _PyUnicode_ToDigit
@@ -866,9 +867,17 @@ extern_libpython! {
866867
// skipped Py_UNICODE_ISNUMERIC
867868
// skipped Py_UNICODE_ISPRINTABLE
868869

870+
#[cfg(not(PyPy))]
869871
pub unsafe extern "C" fn Py_UNICODE_TODECIMAL(ch: Py_UCS4) -> c_int {
870872
_PyUnicode_ToDecimalDigit(ch)
871873
}
874+
875+
#[cfg(PyPy)]
876+
extern_libpython! {
877+
#[cfg_attr(PyPy, link_name = "PyPy_UNICODE_TODECIMAL")]
878+
pub fn Py_UNICODE_TODECIMAL(ch: Py_UCS4) -> c_int;
879+
}
880+
872881
// skipped Py_UNICODE_TODIGIT
873882
// skipped Py_UNICODE_TONUMERIC
874883

0 commit comments

Comments
 (0)