Skip to content

Commit 1bf57a8

Browse files
committed
Treat RUBY_DATA_FUNC as unsafe.Pointer
1 parent 7b5ae04 commit 1bf57a8

File tree

1 file changed

+2
-2
lines changed
  • _tools/ruby_h_to_go/lib/ruby_h_to_go

1 file changed

+2
-2
lines changed

_tools/ruby_h_to_go/lib/ruby_h_to_go/helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def ruby_c_type_to_go_type(typename, type: nil, pointer: nil)
8282
return "Longlong"
8383
when "unsigned LONG_LONG"
8484
return "Ulonglong"
85-
when /^VALUE\s*\(\*func\)\s*\(ANYARGS\)$/
85+
when /^VALUE\s*\(\*func\)\s*\(ANYARGS\)$/, "RUBY_DATA_FUNC"
8686
return "unsafe.Pointer"
8787
when /^[A-Z]+$/, "int"
8888
# e.g. VALUE
@@ -111,7 +111,7 @@ def cast_to_cgo_type(typename)
111111
return "C.Longlong"
112112
when "unsigned LONG_LONG"
113113
return "C.Ulonglong"
114-
when /^VALUE\s*\(\*func\)\s*\(ANYARGS\)$/
114+
when /^VALUE\s*\(\*func\)\s*\(ANYARGS\)$/, "RUBY_DATA_FUNC"
115115
return "toCPointer"
116116
end
117117

0 commit comments

Comments
 (0)