]> sigrok.org Git - libsigrok.git/commitdiff
Bindings: Make Ruby bindings build with Ruby 2.0
authorMarcus Comstedt <redacted>
Wed, 16 Nov 2016 15:42:37 +0000 (16:42 +0100)
committerUwe Hermann <redacted>
Mon, 5 Dec 2016 00:10:37 +0000 (01:10 +0100)
The alias "rb_ary_new_from_args" for "rb_ary_new3" was not introduced
until in Ruby 2.1.

bindings/ruby/classes.i

index 96bd3770d28d76666330a8034b3c6d127814614c..5e4baf07db74eaa7cdadaedec9340acb48d11641 100644 (file)
@@ -140,7 +140,7 @@ static VALUE variant_to_ruby(Glib::VariantBase variant)
 
         VALUE string_obj = rb_external_str_new_with_enc(message.c_str(), message.length(), rb_utf8_encoding());
 
-        VALUE args = rb_ary_new_from_args(2, log_obj, string_obj);
+        VALUE args = rb_ary_new3(2, log_obj, string_obj);
         rb_proc_call(*proc.get(), args);
     };
 }
@@ -176,7 +176,7 @@ static VALUE variant_to_ruby(Glib::VariantBase variant)
             SWIG_as_voidptr(new std::shared_ptr<sigrok::Packet>(packet)),
             SWIGTYPE_p_std__shared_ptrT_sigrok__Packet_t, SWIG_POINTER_OWN);
 
-        VALUE args = rb_ary_new_from_args(2, device_obj, packet_obj);
+        VALUE args = rb_ary_new3(2, device_obj, packet_obj);
         rb_proc_call(*proc.get(), args);
     };
 }