diff --git a/rjit_c.rb b/rjit_c.rb index d311c55b56..045f9a9df5 100644 --- a/rjit_c.rb +++ b/rjit_c.rb @@ -1210,7 +1210,7 @@ module RubyVM::RJIT # :nodoc: all def C.rb_method_cfunc_t @rb_method_cfunc_t ||= CType::Struct.new( "rb_method_cfunc_struct", Primitive.cexpr!("SIZEOF(struct rb_method_cfunc_struct)"), - func: [CType::Immediate.parse("void *"), Primitive.cexpr!("OFFSETOF((*((struct rb_method_cfunc_struct *)NULL)), func)")], + func: [self.rb_cfunc_t, Primitive.cexpr!("OFFSETOF((*((struct rb_method_cfunc_struct *)NULL)), func)")], invoker: [CType::Immediate.parse("void *"), Primitive.cexpr!("OFFSETOF((*((struct rb_method_cfunc_struct *)NULL)), invoker)")], argc: [CType::Immediate.parse("int"), Primitive.cexpr!("OFFSETOF((*((struct rb_method_cfunc_struct *)NULL)), argc)")], ) @@ -1594,6 +1594,10 @@ module RubyVM::RJIT # :nodoc: all CType::Stub.new(:rb_event_flag_t) end + def C.rb_cfunc_t + CType::Stub.new(:rb_cfunc_t) + end + def C.rb_method_alias_t CType::Stub.new(:rb_method_alias_t) end diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs index e1cfeec22b..02b4de68f3 100644 --- a/yjit/src/cruby_bindings.inc.rs +++ b/yjit/src/cruby_bindings.inc.rs @@ -411,10 +411,11 @@ pub const VM_METHOD_TYPE_OPTIMIZED: rb_method_type_t = 9; pub const VM_METHOD_TYPE_MISSING: rb_method_type_t = 10; pub const VM_METHOD_TYPE_REFINED: rb_method_type_t = 11; pub type rb_method_type_t = u32; +pub type rb_cfunc_t = ::std::option::Option VALUE>; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rb_method_cfunc_struct { - pub func: ::std::option::Option VALUE>, + pub func: rb_cfunc_t, pub invoker: ::std::option::Option< unsafe extern "C" fn( recv: VALUE,