1use crate::object::*;
2use std::os::raw::c_int;
3#[cfg(not(PyPy))]
4use std::ptr::addr_of_mut;
5
6extern "C" {
7 #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Here")]
8 pub fn PyTraceBack_Here(arg1: *mut crate::PyFrameObject) -> c_int;
9 #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Print")]
10 pub fn PyTraceBack_Print(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
11}
12
13#[cfg_attr(windows, link(name = "pythonXY"))]
14extern "C" {
15 #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Type")]
16 pub static mut PyTraceBack_Type: PyTypeObject;
17
18 #[cfg(PyPy)]
19 #[link_name = "PyPyTraceBack_Check"]
20 pub fn PyTraceBack_Check(op: *mut PyObject) -> c_int;
21}
22
23#[inline]
24#[cfg(not(PyPy))]
25pub unsafe fn PyTraceBack_Check(op: *mut PyObject) -> c_int {
26 (Py_TYPE(ob:op) == addr_of_mut!(PyTraceBack_Type)) as c_int
27}
28