summaryrefslogtreecommitdiff
path: root/src/if_ruby.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-20 12:52:29 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-20 12:52:29 +0200
commit10f3a79e898fa819e3f78adff7b724c930fc9130 (patch)
treeb42308142626031487216aaa4ca5bbc40dcde4fc /src/if_ruby.c
parentba40447ab14c79b6bf3c6e1d47f2b9dcd3e0524c (diff)
downloadvim-git-10f3a79e898fa819e3f78adff7b724c930fc9130.tar.gz
updated for version 7.3.974v7.3.974
Problem: Can't build with ruby 1.8.5. Solution: Only use ruby_init_stack() when RUBY_INIT_STACK is defined. (Yukihiro Nakadaira)
Diffstat (limited to 'src/if_ruby.c')
-rw-r--r--src/if_ruby.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/if_ruby.c b/src/if_ruby.c
index da4b8b274..44fd5ee42 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -158,8 +158,10 @@ static void error_print(int);
static void ruby_io_init(void);
static void ruby_vim_init(void);
-#if defined(__ia64) && !defined(ruby_init_stack)
-# define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
+#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
+# if defined(__ia64) && !defined(ruby_init_stack)
+# define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
+# endif
#endif
#if defined(DYNAMIC_RUBY) || defined(PROTO)
@@ -231,12 +233,14 @@ static void ruby_vim_init(void);
# define rb_float_new dll_rb_float_new
# define rb_ary_new dll_rb_ary_new
# define rb_ary_push dll_rb_ary_push
-# ifdef __ia64
-# define rb_ia64_bsp dll_rb_ia64_bsp
-# undef ruby_init_stack
-# define ruby_init_stack(addr) dll_ruby_init_stack((addr), rb_ia64_bsp())
-# else
-# define ruby_init_stack dll_ruby_init_stack
+# if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
+# ifdef __ia64
+# define rb_ia64_bsp dll_rb_ia64_bsp
+# undef ruby_init_stack
+# define ruby_init_stack(addr) dll_ruby_init_stack((addr), rb_ia64_bsp())
+# else
+# define ruby_init_stack dll_ruby_init_stack
+# endif
# endif
# else
# define rb_str2cstr dll_rb_str2cstr
@@ -346,11 +350,13 @@ static char * (*dll_rb_string_value_ptr) (volatile VALUE*);
static VALUE (*dll_rb_float_new) (double);
static VALUE (*dll_rb_ary_new) (void);
static VALUE (*dll_rb_ary_push) (VALUE, VALUE);
-# ifdef __ia64
+# if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
+# ifdef __ia64
static void * (*dll_rb_ia64_bsp) (void);
static void (*dll_ruby_init_stack)(VALUE*, void*);
-# else
+# else
static void (*dll_ruby_init_stack)(VALUE*);
+# endif
# endif
# endif
# ifdef RUBY19_OR_LATER
@@ -491,10 +497,6 @@ static struct
# endif
# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
{"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr},
-# ifdef __ia64
- {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp},
-# endif
- {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
# if DYNAMIC_RUBY_VER <= 19
{"rb_float_new", (RUBY_PROC*)&dll_rb_float_new},
# else
@@ -513,6 +515,12 @@ static struct
{"rb_require", (RUBY_PROC*)&dll_rb_require},
{"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options},
# endif
+# if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
+# ifdef __ia64
+ {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp},
+# endif
+ {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
+# endif
{"", NULL},
};
@@ -735,7 +743,7 @@ static int ensure_ruby_initialized(void)
NtInitialize(&argc, &argv);
#endif
{
-#if defined(RUBY_VERSION) && RUBY_VERSION >= 18
+#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
ruby_init_stack(ruby_stack_start);
#endif
ruby_init();