Skip to content

Commit eb1f1b1

Browse files
committed
Fix rb_data_typed_object_make
1 parent dc8eccf commit eb1f1b1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

_tools/ruby_h_to_go/lib/ruby_header_parser/data.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ function:
5656
- rb_gc_guarded_ptr_val
5757

5858
pointer_hint:
59+
rb_data_typed_object_make:
60+
3: sref
5961
rb_define_global_function:
6062
2: function
6163
rb_define_method:

_tools/ruby_h_to_go/spec/ruby_header_parser/parser_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,24 @@
267267
its(:typeref) { should eq typedef(type: "char", pointer: :ref) }
268268
its(:args) { should eq args }
269269
end
270+
271+
context "rb_data_typed_object_make" do
272+
subject { definitions.find { |d| d.name == "rb_data_typed_object_make" } }
273+
274+
let(:args) do
275+
[
276+
argument(type: "VALUE", name: "klass"),
277+
argument(type: "rb_data_type_t", name: "type", pointer: :ref),
278+
argument(type: "void", name: "datap", pointer: :sref, length: 2),
279+
argument(type: "size_t", name: "size"),
280+
]
281+
end
282+
283+
its(:name) { should eq "rb_data_typed_object_make" }
284+
its(:definition) { should eq "rb_data_typed_object_make(VALUE klass, const rb_data_type_t *type, void **datap, size_t size)" }
285+
its(:typeref) { should eq typedef(type: "VALUE") }
286+
its(:args) { should eq args }
287+
end
270288
end
271289

272290
describe "#extract_struct_definitions" do

0 commit comments

Comments
 (0)