mruby.h: fix build with MRB_NO_METHOD_CACHE

mrb_method_cache_clear() was called unconditionally from class.c and
state.c, but the function definition was guarded by MRB_NO_METHOD_CACHE.
This caused linker errors when building with MRB_NO_METHOD_CACHE defined.

Add empty macro definition when MRB_NO_METHOD_CACHE is defined, matching
the existing pattern used for mrb_mc_clear_by_class().

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-12-22 13:55:42 +09:00
parent 58604ba1d5
commit 98c33acc75
+4
View File
@@ -1268,7 +1268,11 @@ MRB_API mrb_state* mrb_open_core(void);
* Pointer to the mrb_state to be closed.
*/
MRB_API void mrb_close(mrb_state *mrb);
#ifndef MRB_NO_METHOD_CACHE
MRB_API void mrb_method_cache_clear(mrb_state *mrb);
#else
#define mrb_method_cache_clear(mrb) ((void)0)
#endif
/**
* Check if mrb_open() failed