The patch looks good but the declaration here is unnecessary for the versions MRUBY_RELEASE_NO > 10000 and might be harmful.  Moving it into #ifdef scope is safer.
```
#if MRUBY_RELEASE_NO < 10000
mrb_value mrb_yield_internal(mrb_state *mrb, mrb_value b, int argc, mrb_value *argv, mrb_value self, struct RClass *c);
#define mrb_yield_with_class mrb_yield_internal
#endif
```