added coro and asyncgen types

This commit is contained in:
Nikolay Kim 2017-05-02 23:15:20 -07:00
parent c4e3be6772
commit c9904f045a
1 changed files with 47 additions and 0 deletions

View File

@ -37,3 +37,50 @@ pub unsafe fn PyGen_CheckExact(op: *mut PyObject) -> c_int {
pub fn PyGen_NeedsFinalizing(op: *mut PyGenObject) -> c_int;
}
#[cfg(Py_3_5)]
#[cfg_attr(windows, link(name="pythonXY"))] extern "C" {
pub static mut PyCoro_Type: PyTypeObject;
}
#[cfg(Py_3_5)]
#[inline(always)]
pub unsafe fn PyCoro_Check(op: *mut PyObject) -> c_int {
PyObject_TypeCheck(op, &mut PyCoro_Type)
}
#[cfg(not(Py_3_5))]
#[inline(always)]
pub unsafe fn PyCoro_Check(op: *mut PyObject) -> c_int {
0
}
#[cfg(Py_3_5)]
#[cfg_attr(windows, link(name="pythonXY"))] extern "C" {
pub static mut _PyCoroWrapper_Type: PyTypeObject;
}
#[cfg(Py_3_5)]
#[inline(always)]
pub unsafe fn PyCoroWrapper_Check(op: *mut PyObject) -> c_int {
PyObject_TypeCheck(op, &mut _PyCoroWrapper_Type)
}
#[cfg(not(Py_3_5))]
#[inline(always)]
pub unsafe fn PyCoroWrapper_Check(op: *mut PyObject) -> c_int {
0
}
#[cfg(Py_3_5)]
#[cfg_attr(windows, link(name="pythonXY"))] extern "C" {
pub static mut PyAsyncGen_Type: PyTypeObject;
}
#[cfg(Py_3_5)]
#[inline(always)]
pub unsafe fn PyAsyncGen_Check(op: *mut PyObject) -> c_int {
PyObject_TypeCheck(op, &mut PyAsyncGen_Type)
}
#[cfg(not(Py_3_5))]
#[inline(always)]
pub unsafe fn PyAsyncGen_Check(op: *mut PyObject) -> c_int {
0
}