Skip to content

Commit 3539ab6

Browse files
authored
Merge pull request #10 from sue445/feature/remove_macro
Remove macro support in ruby.h
2 parents ab57173 + 45e8db5 commit 3539ab6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/ruby_header_parser/parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def create_typeref(definition:, function_name:, typeref_field:, filepath:, line_
232232
def parse_typeref_type(definition:, function_name:, typeref_field:, filepath:, line_num:)
233233
typeref_type =
234234
if typeref_field
235-
typeref_field.gsub(/[A-Z_]+\s*\(\(.*\)\)/, "").gsub("RUBY_SYMBOL_EXPORT_BEGIN", "")
235+
typeref_field.gsub(/[A-Z_]+\s*\(\(.*\)\)/, "")
236236
else
237237
# parse typeref in definition
238238
type = definition[0...definition.index(function_name)] || ""

lib/ruby_header_parser/util.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def self.split_signature(signature)
2323
# @param type [String]
2424
# @return [String]
2525
def self.sanitize_type(type)
26-
type.gsub(/(RUBY_EXTERN|enum|volatile|const|struct|static\s+inline)\s+/i, "").gsub("const*", "").strip
26+
type.gsub(/(enum|volatile|const|struct|static\s+inline)\s+/i, "").gsub("const*", "").strip
2727
end
2828
end
2929
end

spec/ruby_header_parser/util_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
subject { RubyHeaderParser::Util.sanitize_type(type) }
6060

6161
using RSpec::Parameterized::TableSyntax
62+
6263
where(:type, :expected) do
63-
"RUBY_EXTERN int" | "int"
64-
"RUBY_EXTERN volatile int" | "int"
64+
"volatile int" | "int"
6565
"enum rb_io_buffer_flags" | "rb_io_buffer_flags"
6666
"const char*" | "char*"
6767
"volatile size_t" | "size_t"

0 commit comments

Comments
 (0)