From 7cb65e34793a25c426d54320cc76fb96facf4053 Mon Sep 17 00:00:00 2001 From: ZakatTeamI2P Date: Sun, 19 Apr 2026 08:06:56 +0200 Subject: [PATCH] th40g27thbg29-nd[kjfg-3o0ng --- binding-mri/binding-mri.cpp | 10 +++++++--- binding-mri/filesystem-binding.cpp | 16 ++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index 3374e7a..e320bee 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -249,15 +249,19 @@ static void processReset(){ false); } +static VALUE rgssMainCb_wrapper(VALUE data){ return rgssMainCb(data); } + +static VALUE rgssMainRescue_wrapper(VALUE data, VALUE ex){ return rgssMainRescue(data, ex); } + RB_METHOD(mriRgssMain){ RB_UNUSED_PARAM; while (true){ VALUE exc = Qnil; - rb_rescue2((VALUE(*)(ANYARGS)) rgssMainCb, rb_block_proc(), - (VALUE(*)(ANYARGS)) rgssMainRescue, (VALUE) &exc, - rb_eException, (VALUE) 0); + rb_rescue2(rgssMainCb_wrapper, rb_block_proc(), + rgssMainRescue_wrapper, (VALUE)&exc, + rb_eException, (VALUE)0); if (NIL_P(exc)) break; diff --git a/binding-mri/filesystem-binding.cpp b/binding-mri/filesystem-binding.cpp index 013903f..09fc020 100644 --- a/binding-mri/filesystem-binding.cpp +++ b/binding-mri/filesystem-binding.cpp @@ -183,22 +183,22 @@ void fileIntBindingInit(){ VALUE klass = rb_define_class("FileInt", rb_cIO); rb_define_alloc_func(klass, classAllocate<&FileIntType>); - _rb_define_method(klass, "read", fileIntRead); - _rb_define_method(klass, "getbyte", fileIntGetByte); - _rb_define_method(klass, "binmode", fileIntBinmode); - _rb_define_method(klass, "close", fileIntClose); + rb_define_method(klass, "read", RUBY_METHOD_FUNC(fileIntRead), -1); + rb_define_method(klass, "getbyte", RUBY_METHOD_FUNC(fileIntGetByte), 0); + rb_define_method(klass, "binmode", RUBY_METHOD_FUNC(fileIntBinmode), 0); + rb_define_method(klass, "close", RUBY_METHOD_FUNC(fileIntClose), 0); - _rb_define_module_function(rb_mKernel, "load_data", kernelLoadData); - _rb_define_module_function(rb_mKernel, "save_data", kernelSaveData); + rb_define_module_function(rb_mKernel, "load_data", RUBY_METHOD_FUNC(kernelLoadData), -1); + rb_define_module_function(rb_mKernel, "save_data", RUBY_METHOD_FUNC(kernelSaveData), -1); /* We overload the built-in 'Marshal::load()' function to silently * insert our utf8proc that ensures all read strings will be * UTF-8 encoded */ VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal")); - if(marsh = Qnil){ + if(marsh == Qnil){ printf("BrUh: cant get Marshal\n"); exit(1); } rb_define_alias(rb_singleton_class(marsh), "_mkxp_load_alias", "load"); - _rb_define_module_function(marsh, "load", _marshalLoad); + rb_define_module_function(marsh, "load", RUBY_METHOD_FUNC(_marshalLoad), -1); }