Skip to content

Commit a3ddccf

Browse files
authored
Merge pull request #324 from ruby-go-gem/doc_limitation
doc: Add limitation
2 parents 84a3605 + 6b32a17 commit a3ddccf

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,24 @@ Most of the methods defined in `ruby.h` are automatically generated and defined
122122

123123
However, some of the methods listed below are not supported.
124124

125-
1. deprecated or internal methods
126-
* See `function.exclude_name` in https://github.com/ruby-go-gem/ruby_header_parser/blob/main/config/default.yml
127-
2. Methods with variable-length arguments
128-
* Because Go's variable-length arguments couldn't be passed directly to C.
129-
* However, it is possible to execute functions with variable length arguments in CRuby from Go with a hack like `RbRaise` in [ruby/ruby_internal_error.go](ruby/ruby_internal_error.go)
125+
#### 1. deprecated or internal methods
126+
See `function.exclude_name` in https://github.com/ruby-go-gem/ruby_header_parser/blob/main/config/default.yml
127+
128+
#### 2. Methods with variable-length arguments
129+
Because Go's variable-length arguments couldn't be passed directly to C.
130+
131+
However, it is possible to execute functions with variable length arguments in CRuby from Go with a hack like `RbRaise` in [ruby/ruby_internal_error.go](ruby/ruby_internal_error.go)
132+
133+
#### 3. Macro functions
134+
https://github.com/ruby-go-gem/ruby_header_parser parses the preprocessed `ruby.h`. [^preprocessed]
135+
136+
[^preprocessed]: https://github.com/ruby-go-gem/ruby_header_parser/blob/v0.4.2/lib/ruby_header_parser/parser.rb#L166-L173
137+
138+
Since preprocessed header files don't contain macro functions, they are not automatically generated.
139+
140+
If you need a macro function, please implement it yourself and submit a patch.
141+
142+
See https://github.com/ruby-go-gem/go-gem-wrapper/pull/323
130143

131144
## Developing
132145
### Build

0 commit comments

Comments
 (0)