diff --git a/include/ruby/defines.h b/include/ruby/defines.h index b49fabe636..375e039d4b 100644 --- a/include/ruby/defines.h +++ b/include/ruby/defines.h @@ -270,9 +270,11 @@ void xfree(void*); #define RUBY_FUNC_EXPORTED #endif -/* MJIT_FUNC_EXPORTED is used for functions which are exported only for MJIT +/* These macros are used for functions which are exported only for MJIT and NOT ensured to be exported in future versions. */ #define MJIT_FUNC_EXPORTED RUBY_FUNC_EXPORTED +#define MJIT_SYMBOL_EXPORT_BEGIN RUBY_SYMBOL_EXPORT_BEGIN +#define MJIT_SYMBOL_EXPORT_END RUBY_SYMBOL_EXPORT_END #ifndef RUBY_EXTERN #define RUBY_EXTERN extern diff --git a/numeric.c b/numeric.c index 0e2804329d..c5ff98b7d7 100644 --- a/numeric.c +++ b/numeric.c @@ -1603,7 +1603,7 @@ flo_le(VALUE x, VALUE y) * so an implementation-dependent value is returned. */ -VALUE +MJIT_FUNC_EXPORTED VALUE rb_float_eql(VALUE x, VALUE y) { if (RB_TYPE_P(y, T_FLOAT)) { diff --git a/string.c b/string.c index 28b873523f..ebf5618c88 100644 --- a/string.c +++ b/string.c @@ -3263,7 +3263,7 @@ rb_str_equal(VALUE str1, VALUE str2) * Two strings are equal if they have the same length and content. */ -VALUE +MJIT_FUNC_EXPORTED VALUE rb_str_eql(VALUE str1, VALUE str2) { if (str1 == str2) return Qtrue; diff --git a/tool/ruby_vm/views/_insn_name_info.erb b/tool/ruby_vm/views/_insn_name_info.erb index 79a48cd9cb..581869fca8 100644 --- a/tool/ruby_vm/views/_insn_name_info.erb +++ b/tool/ruby_vm/views/_insn_name_info.erb @@ -13,7 +13,9 @@ % CONSTFUNC(MAYBE_UNUSED(static const char *insn_name(VALUE insn))); extern const char *rb_vm_insn_name_info; +MJIT_SYMBOL_EXPORT_BEGIN extern const unsigned short rb_vm_insn_name_offset[]; +MJIT_SYMBOL_EXPORT_END #ifdef RUBY_VM_INSNS_INFO const unsigned short rb_vm_insn_name_offset[] = { diff --git a/vm.c b/vm.c index 518aabb382..93134ff78f 100644 --- a/vm.c +++ b/vm.c @@ -1302,7 +1302,7 @@ rb_source_location(int *pline) } } -const char * +MJIT_FUNC_EXPORTED const char * rb_source_location_cstr(int *pline) { VALUE path = rb_source_location(pline);