-
Notifications
You must be signed in to change notification settings - Fork 341
Closed
Description
FFI is unable to attach functions when instructed to use method names ending in ? or ! - both of which are common Ruby-isms. The following illustrates the problem:
require "ffi"
# => true
module Foo
extend FFI::Library
ffi_lib 'c'
attach_function :malloc!, :malloc, [:size_t], :pointer
end
# Traceback (most recent call last):
# ...
# 3: from (irb):6:in `<module:Foo>'
# 2: from /Users/nate.eizenga/.asdf/installs/ruby/2.6.10/lib/ruby/gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275:in `attach_function'
# 1: from /Users/nate.eizenga/.asdf/installs/ruby/2.6.10/lib/ruby/gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275:in `attach'
# NameError (wrong class variable name @@malloc!)rubyFeedback
Metadata
Metadata
Assignees
Labels
No labels