On Saturday, May 11, 2013 10:11:27 PM UTC+9, Yukihiro Nakadaira wrote:
> ruby_init_stack() is also required for static linked version.
> 
> And ruby_init_stack() is defined as
> 
> ruby-2.0-0-p0:
> #ifdef __ia64
> void ruby_init_stack(volatile VALUE*, void*);
> #define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
> #else
> void ruby_init_stack(volatile VALUE*);
> 
> #endif
> 
> 
> 
> ruby-1.8.7-p371:
> #ifdef __ia64
> void ruby_init_stack(VALUE*, void*);
> #define RUBY_INIT_STACK \
>     VALUE variable_in_this_stack_frame; \
>     ruby_init_stack(&variable_in_this_stack_frame, rb_ia64_bsp());
> 
> #else
> void ruby_init_stack(VALUE*);
> #define RUBY_INIT_STACK \
>     VALUE variable_in_this_stack_frame; \
>     ruby_init_stack(&variable_in_this_stack_frame);
> #endif
> 
> 
> 
> So, We should handle __ia64.
> 

Thank you. I don't have __ia64 environment, but I think this would work.
Could you review the following?


diff --git a/src/if_ruby.c b/src/if_ruby.c
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -153,16 +153,22 @@ static VALUE cVimWindow;
 static VALUE eDeletedBufferError;
 static VALUE eDeletedWindowError;
 
 static int ensure_ruby_initialized(void);
 static void error_print(int);
 static void ruby_io_init(void);
 static void ruby_vim_init(void);
 
+#ifdef __ia64
+#ifndef ruby_init_stack
+# define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
+#endif
+#endif
+
 #if defined(DYNAMIC_RUBY) || defined(PROTO)
 #ifdef PROTO
 # define HINSTANCE int         /* for generating prototypes */
 #endif
 
 /*
  * Wrapper defines
  */
@@ -712,17 +718,17 @@ static int ensure_ruby_initialized(void)
 #endif
 #ifdef _WIN32
            /* suggested by Ariya Mizutani */
            int argc = 1;
            char *argv[] = {"gvim.exe"};
            NtInitialize(&argc, &argv);
 #endif
            {
-#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
+#if defined(RUBY_VERSION) && RUBY_VERSION >= 18
                ruby_init_stack(ruby_stack_start);
 #endif
                ruby_init();
            }
 #ifdef RUBY19_OR_LATER
            {
                int dummy_argc = 2;
                char *dummy_argv[] = {"vim-ruby", "-e0"};

-- 
-- 
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