aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.h
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 13:11:27 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 13:11:27 +0000
commit24b0e07e9373f3a94408a85eaa580132325ef2f7 (patch)
treec5a935aea06cf874a03759fefcb94677fe2c785e /mjit.h
parent726ecacdeec2bb210138f0e8433493d1b3293f4a (diff)
downloadruby-24b0e07e9373f3a94408a85eaa580132325ef2f7.tar.gz
mjit.h: introduce MJIT_STATIC for full mswin JIT support
This change resolves most of major remaining MJIT bugs on mswin. Since Visual Studio doesn't support generating pre-processed code preserving macros, we can't use transform_mjit_header approach for mswin. So we need to transform MJIT header using macro like this. vm.c: use MJIT_STATIC for non-static functions that exist on MJIT header and cause conflict on link. vm_insnhelper.c: ditto test_jit.rb: remove many skips for mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.h')
-rw-r--r--mjit.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/mjit.h b/mjit.h
index 0efa04ac8d..1a339deaa9 100644
--- a/mjit.h
+++ b/mjit.h
@@ -11,6 +11,18 @@
#include "ruby.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
+
/* Special address values of a function generated from the
corresponding iseq by MJIT: */
enum rb_mjit_iseq_func {