Mercurial > vim
comparison src/if_ruby.c @ 4279:cb0c694517a0 v7.3.889
updated for version 7.3.889
Problem: Can't build with Ruby 2.0 on a 64 bit system.
Solution: Define rb_fix2int and rb_num2int. (Kohei Suzuki)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 14 Apr 2013 16:19:03 +0200 |
parents | e49b80f267dc |
children | 04736b4030ec |
comparison
equal
deleted
inserted
replaced
4278:9b772e48f79e | 4279:cb0c694517a0 |
---|---|
84 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 | 84 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19 |
85 /* Ruby 1.9 defines a number of static functions which use rb_num2long and | 85 /* Ruby 1.9 defines a number of static functions which use rb_num2long and |
86 * rb_int2big */ | 86 * rb_int2big */ |
87 # define rb_num2long rb_num2long_stub | 87 # define rb_num2long rb_num2long_stub |
88 # define rb_int2big rb_int2big_stub | 88 # define rb_int2big rb_int2big_stub |
89 #endif | |
90 | |
91 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 \ | |
92 && SIZEOF_INT < SIZEOF_LONG | |
93 /* Ruby 2.0 defines a number of static functions which use rb_fix2int and | |
94 * rb_num2int if SIZEOF_INT < SIZEOF_LONG (64bit) */ | |
95 # define rb_fix2int rb_fix2int_stub | |
96 # define rb_num2int rb_num2int_stub | |
89 #endif | 97 #endif |
90 | 98 |
91 #include <ruby.h> | 99 #include <ruby.h> |
92 #ifdef RUBY19_OR_LATER | 100 #ifdef RUBY19_OR_LATER |
93 # include <ruby/encoding.h> | 101 # include <ruby/encoding.h> |
350 } | 358 } |
351 VALUE rb_int2big_stub(SIGNED_VALUE x) | 359 VALUE rb_int2big_stub(SIGNED_VALUE x) |
352 { | 360 { |
353 return dll_rb_int2big(x); | 361 return dll_rb_int2big(x); |
354 } | 362 } |
363 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 \ | |
364 && SIZEOF_INT < SIZEOF_LONG | |
365 long rb_fix2int_stub(VALUE x) | |
366 { | |
367 return dll_rb_fix2int(x); | |
368 } | |
369 long rb_num2int_stub(VALUE x) | |
370 { | |
371 return dll_rb_num2int(x); | |
372 } | |
373 #endif | |
355 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 | 374 #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 |
356 VALUE | 375 VALUE |
357 rb_float_new_in_heap(double d) | 376 rb_float_new_in_heap(double d) |
358 { | 377 { |
359 return dll_rb_float_new(d); | 378 return dll_rb_float_new(d); |