ruby: Support for loading Ruby 2.x libruby

Check for rb_float_new and rb_float_new_in_heap, as documented in #271
develop
lethosor 2016-10-08 16:59:03 -04:00
parent f6a91c2f30
commit 2806fe73a9
1 changed files with 3 additions and 1 deletions

@ -355,12 +355,14 @@ static int df_loadruby(void)
rbloadsym(rb_string_value_ptr);
rbloadsym(rb_eval_string_protect);
rbloadsym(rb_ary_shift);
rbloadsym(rb_float_new);
rbloadsym(rb_num2dbl);
rbloadsym(rb_int2inum);
rbloadsym(rb_uint2inum);
rbloadsym(rb_num2ulong);
#undef rbloadsym
if (!((rb_float_new = (decltype(rb_float_new))(LookupPlugin(libruby_handle, "rb_float_new"))) ||
(rb_float_new = (decltype(rb_float_new))(LookupPlugin(libruby_handle, "rb_float_new_in_heap")))))
return 0;
return 1;
}