From ad2d2e3f0f10d7444398b5000fc2eacd99c9eaf4 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Mon, 8 Oct 2018 13:46:42 +0000 Subject: include/ruby/ruby.h: import external symbols properly on MinGW MJIT. test_jit.rb: all MJIT tests are now passing on MinGW. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index b278d522bb..bd17e2d808 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -28,6 +28,12 @@ extern "C" { #include "defines.h" +/* For MinGW, we need __declspec(dllimport) for RUBY_EXTERN on MJIT. mswin's RUBY_EXTERN already has that. */ +#if defined(MJIT_HEADER) && defined(_WIN32) && defined(__GNUC__) +# undef RUBY_EXTERN +# define RUBY_EXTERN extern __declspec(dllimport) +#endif + #if defined(__cplusplus) /* __builtin_choose_expr and __builtin_types_compatible aren't available * on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ -- cgit v1.2.3