From d590027fd24924d33e6858706c3c8235aa19255c Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sun, 7 Oct 2018 13:34:59 +0000 Subject: vm_core.h: fix inconsistent prototype declarations like "error: static declaration of 'xxx' follows non-static declaration". r64940 is successfully built on mswin but not built on almost all other environments. internal.h: ditto include/ruby/intern.h: MJIT_STATIC is moved to this file since this file also needs to use this. mjit.h: MJIT_STATIC is moved from this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/intern.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/ruby') diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 813145ed2d..3c625b42e9 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -34,6 +34,18 @@ extern "C" { #include "ruby/st.h" +/* On mswin, MJIT header transformation can't be used since cl.exe can't output + preprocessed output preserving macros. So this `MJIT_STATIC` is needed + to force non-static function to static on MJIT header to avoid symbol conflict. + `MJIT_FUNC_EXPORTED` is also changed to `static` on MJIT header for the same reason. */ +#ifdef MJIT_HEADER +# define MJIT_STATIC static +# undef MJIT_FUNC_EXPORTED +# define MJIT_FUNC_EXPORTED static +#else +# define MJIT_STATIC +#endif + RUBY_SYMBOL_EXPORT_BEGIN /* @@ -286,7 +298,7 @@ int rb_sourceline(void); const char *rb_sourcefile(void); VALUE rb_check_funcall(VALUE, ID, int, const VALUE*); -NORETURN(void rb_error_arity(int, int, int)); +NORETURN(MJIT_STATIC void rb_error_arity(int, int, int)); static inline int rb_check_arity(int argc, int min, int max) { -- cgit v1.2.3