On Mon, May 20, 2013 at 4:37 AM, Christian J. Robinson <[email protected]>wrote:

> On Sun, 19 May 2013, Bram Moolenaar wrote:
>
>
>  Christian J. Robinson wrote:
>>
>>  [..]/vim73/src/if_ruby.c:739: undefined reference to `ruby_init_stack'
>>> collect2: ld returned 1 exit status
>>> link.sh: Linking failed
>>> make: *** [vim] Error 1
>>>
>>
>> What version of Ruby are you using? ruby_init_stack() is supposed to be
>> called only for Ruby 1.8 and later.
>>
>
> % ruby --version
> ruby 1.8.5 (2006-08-25) [x86_64-linux]


Indeed, ruby_init_stack() is not defined in ruby-1.8.5.  It was added to
ruby-1.8.6.  How about to check if RUBY_INIT_STACK is defined for
workaround.


diff -r 0917206e7317 src/if_ruby.c
--- a/src/if_ruby.c    Sun May 19 22:31:18 2013 +0200
+++ b/src/if_ruby.c    Mon May 20 14:06:47 2013 +0900
@@ -231,12 +231,14 @@
 #  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
@@ -491,10 +493,6 @@
 # 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 +511,12 @@
     {"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 +739,7 @@
         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();


-- 
Yukihiro Nakadaira - [email protected]

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui