aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-08 13:46:42 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-08 13:46:42 +0000
commit582351294153c23894c7d47e88779ede04a56881 (patch)
tree341cf51d935bd045c754fb79c9e6754261b52b9c /include
parent544d5cb134bf8c6c956f0ef5495b7872f53e18cd (diff)
downloadruby-582351294153c23894c7d47e88779ede04a56881.tar.gz
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
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h6
1 files changed, 6 insertions, 0 deletions
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 */