summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/ruby.h')
-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 */