I've been trying to get dynamic ruby support working on Solaris, with a
64-bit build of vim 7.4.192 and Ruby 1.9.  I was getting a pair of link
errors about rb_fix2int and rb_num2int, and in the course of poking around
found that the following patch seems to work:

    --- src/if_ruby.c.orig  Tue Feb 25 10:14:41 2014
    +++ src/if_ruby.c       Tue Feb 25 10:14:45 2014
    @@ -88,7 +88,7 @@
     # define rb_int2big rb_int2big_stub
     #endif
     
    -#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 \
    +#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 \
            && VIM_SIZEOF_INT < VIM_SIZEOF_LONG
     /* Ruby 2.0 defines a number of static functions which use rb_fix2int and
      * rb_num2int if VIM_SIZEOF_INT < VIM_SIZEOF_LONG (64bit) */
    @@ -392,7 +392,7 @@
     {
         return dll_rb_int2big(x);
     }
    -#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 \
    +#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 \
            && VIM_SIZEOF_INT < VIM_SIZEOF_LONG
     long rb_fix2int_stub(VALUE x)
     {

I don't know whether that's right or not, though, though our ruby.h
definitely uses rb_fix2int() and rb_num2int() in macros, which is what it
sounds like the comment suggests happened in 2.0.

I do get the following warnings, though:

    "if_ruby.c", line 206: warning: macro redefined: rb_fix2int
    "if_ruby.c", line 207: warning: macro redefined: rb_num2int

which isn't surprising, since fist they're #defined to the stub versions,
and here they're #defined to the dll_ versions.

Simple ruby tests work, so it's not all broken, but I don't know enough
Ruby to test these two functions to see if what I've done is completely
busted.

Any help would be appreciated.

Thanks,
Danek

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