Skip to content

Commit d421fc9

Browse files
authored
Merge pull request #281 from ruby-go-gem/fix_RSTRING_END
Treat `RSTRING_END` return value as a `char*` instead of `string`
2 parents b3d5a97 + d87b8ab commit d421fc9

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ group :development do
66
gem "rake"
77
gem "rubocop", require: false
88
gem "rubocop_auto_corrector", require: false
9-
gem "ruby_header_parser", ">= 0.4.1"
9+
gem "ruby_header_parser", ">= 0.4.2"
1010
gem "yard"
1111
end
1212

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ GEM
115115
rubocop_auto_corrector (0.5.0)
116116
rubocop (>= 1.30.0)
117117
ruby-progressbar (1.13.0)
118-
ruby_header_parser (0.4.1)
118+
ruby_header_parser (0.4.2)
119119
securerandom (0.4.1)
120120
serverspec (2.42.3)
121121
multi_json
@@ -173,7 +173,7 @@ DEPENDENCIES
173173
rspec-temp_dir
174174
rubocop
175175
rubocop_auto_corrector
176-
ruby_header_parser (>= 0.4.1)
176+
ruby_header_parser (>= 0.4.2)
177177
serverspec
178178
steep
179179
test-unit

_tools/ruby_h_to_go/exe/ruby_h_to_go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ include_paths ||= DEFAULT_INCLUDE_PATHS
4949
dist_dir ||= DEFAULT_DIST_DIR
5050
dist_preprocessed_header_file ||= DEFAULT_DIST_PREPROCESSED_HEADER_FILE
5151

52+
FileUtils.rm_f(dist_preprocessed_header_file)
53+
5254
RubyHToGo::Cli.new(header_file:, include_paths:, dist_dir:, dist_preprocessed_header_file:).perform

_tools/ruby_h_to_go/spec/ruby_h_to_go/function_definition_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
RubyHeaderParser::FunctionDefinition.new(
305305
name: "RSTRING_END",
306306
definition: "RSTRING_END(VALUE str)",
307-
typeref: typeref(type: "char", pointer: :ref),
307+
typeref: typeref(type: "char", pointer: :raw),
308308
args: [
309309
argument(type: "VALUE", name: "str"),
310310
],
@@ -318,8 +318,8 @@
318318
// Original definition is following
319319
//
320320
// RSTRING_END(VALUE str)
321-
func RSTRING_END(str VALUE) string {
322-
return char2String(C.RSTRING_END(C.VALUE(str)))
321+
func RSTRING_END(str VALUE) *Char {
322+
return (*Char)(C.RSTRING_END(C.VALUE(str)))
323323
}
324324
325325
GO

ruby/function_ruby_3_3_generated.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby/function_ruby_3_4_generated.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)