Skip to content

Commit cc1455b

Browse files
Add fn to macro
1 parent f5f25ff commit cc1455b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎crates/capi/src/object.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustpython_vm::{AsObject, Py};
88
pub type PyTypeObject = Py<PyType>;
99

1010
macro_rules! define_py_check {
11-
($name:ident, $($ctx_path:ident).+) => {
11+
(fn $name:ident, $($ctx_path:ident).+) => {
1212
#[unsafe(no_mangle)]
1313
pub unsafe extern "C" fn $name(obj: *mut crate::PyObject) -> core::ffi::c_int {
1414
crate::pystate::with_vm(|vm| unsafe {
@@ -19,7 +19,7 @@ macro_rules! define_py_check {
1919
})
2020
}
2121
};
22-
(exact $name:ident, $($ctx_path:ident).+) => {
22+
(exact fn $name:ident, $($ctx_path:ident).+) => {
2323
#[unsafe(no_mangle)]
2424
pub unsafe extern "C" fn $name(obj: *mut crate::PyObject) -> core::ffi::c_int {
2525
use rustpython_vm::AsObject;
@@ -33,8 +33,8 @@ macro_rules! define_py_check {
3333
};
3434
}
3535

36-
define_py_check!(PyType_Check, types.type_type);
37-
define_py_check!(exact PyType_CheckExact, types.type_type);
36+
define_py_check!(fn PyType_Check, types.type_type);
37+
define_py_check!(exact fn PyType_CheckExact, types.type_type);
3838

3939
#[unsafe(no_mangle)]
4040
pub unsafe extern "C" fn Py_TYPE(op: *mut PyObject) -> *const PyTypeObject {

0 commit comments

Comments
 (0)