2727#![ allow( clippy:: host_endian_bytes) ]
2828#![ allow( clippy:: if_not_else) ]
2929#![ allow( clippy:: implicit_return) ]
30- #![ allow( clippy:: incompatible_msrv) ] // MSRV 1.89
3130#![ allow( clippy:: inline_always) ]
3231#![ allow( clippy:: let_underscore_untyped) ]
3332#![ allow( clippy:: missing_assert_message) ]
@@ -106,13 +105,20 @@ macro_rules! add {
106105 } ;
107106}
108107
109- #[ cfg( not( Py_3_13 ) ) ]
108+ #[ cfg( all ( Py_3_10 , not( Py_3_13 ) ) ) ]
110109macro_rules! add {
111110 ( $mptr: expr, $name: expr, $obj: expr) => {
112111 crate :: ffi:: PyModule_AddObjectRef ( $mptr, $name. as_ptr( ) , $obj) ;
113112 } ;
114113}
115114
115+ #[ cfg( not( Py_3_10 ) ) ]
116+ macro_rules! add {
117+ ( $mptr: expr, $name: expr, $obj: expr) => {
118+ crate :: ffi:: PyModule_AddObject ( $mptr, $name. as_ptr( ) , $obj) ;
119+ } ;
120+ }
121+
116122macro_rules! opt {
117123 ( $mptr: expr, $name: expr, $opt: expr) => {
118124 #[ cfg( all( not( target_os = "windows" ) , target_pointer_width = "64" ) ) ]
@@ -127,6 +133,7 @@ macro_rules! opt {
127133#[ allow( non_snake_case) ]
128134#[ unsafe( no_mangle) ]
129135#[ cold]
136+ #[ cfg_attr( not( Py_3_10 ) , allow( deprecated) ) ] // _PyCFunctionFastWithKeywords
130137#[ cfg_attr( feature = "optimize" , optimize( size) ) ]
131138pub ( crate ) unsafe extern "C" fn orjson_init_exec ( mptr : * mut PyObject ) -> c_int {
132139 unsafe {
@@ -147,7 +154,10 @@ pub(crate) unsafe extern "C" fn orjson_init_exec(mptr: *mut PyObject) -> c_int {
147154 let wrapped_dumps = Box :: new ( PyMethodDef {
148155 ml_name : c"dumps" . as_ptr ( ) ,
149156 ml_meth : PyMethodDefPointer {
157+ #[ cfg( Py_3_10 ) ]
150158 PyCFunctionFastWithKeywords : dumps,
159+ #[ cfg( not( Py_3_10 ) ) ]
160+ _PyCFunctionFastWithKeywords : dumps,
151161 } ,
152162 ml_flags : crate :: ffi:: METH_FASTCALL | METH_KEYWORDS ,
153163 ml_doc : dumps_doc. as_ptr ( ) ,
0 commit comments