Skip to content

Commit 04f8186

Browse files
committed
Fix Py_UNICODE_TODECIMAL definition for PyPy
1 parent 6d0c1ee commit 04f8186

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pyo3-ffi/src/cpython/unicodeobject.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,17 @@ extern_libpython! {
866866
// skipped Py_UNICODE_ISNUMERIC
867867
// skipped Py_UNICODE_ISPRINTABLE
868868

869+
#[cfg(not(PyPy))]
869870
pub unsafe extern "C" fn Py_UNICODE_TODECIMAL(ch: Py_UCS4) -> c_int {
870871
_PyUnicode_ToDecimalDigit(ch)
871872
}
873+
874+
#[cfg(PyPy)]
875+
extern_libpython! {
876+
#[cfg(link_name = "PyPy_UNICODE_TODECIMAL")]
877+
pub fn Py_UNICODE_TODECIMAL(ch: Py_UCS4) -> c_int;
878+
}
879+
872880
// skipped Py_UNICODE_TODIGIT
873881
// skipped Py_UNICODE_TONUMERIC
874882

0 commit comments

Comments
 (0)