diff options
author | Michael Leibowitz <michael.leibowitz@intel.com> | 2013-08-15 15:02:54 -0700 |
---|---|---|
committer | Michael Leibowitz <michael.leibowitz@intel.com> | 2013-08-15 15:02:54 -0700 |
commit | 6b0e2a11aeccf2ebc707c22548a0c15c8c2bae06 (patch) | |
tree | d9d59f4b502927634d32832e963db76629ff5a2e /ext/dl/lib/dl/import.rb | |
parent | 3b35de2a90e26b99e2a6d4f61dc56d6ce7ded748 (diff) | |
download | ruby-6b0e2a11aeccf2ebc707c22548a0c15c8c2bae06.tar.gz ruby-6b0e2a11aeccf2ebc707c22548a0c15c8c2bae06.tar.bz2 ruby-6b0e2a11aeccf2ebc707c22548a0c15c8c2bae06.zip |
Imported Upstream version 1.9.3.p448upstream/1.9.3.p448upstream
Diffstat (limited to 'ext/dl/lib/dl/import.rb')
-rw-r--r-- | ext/dl/lib/dl/import.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/dl/lib/dl/import.rb b/ext/dl/lib/dl/import.rb index eec65cd..a4fa406 100644 --- a/ext/dl/lib/dl/import.rb +++ b/ext/dl/lib/dl/import.rb @@ -231,11 +231,13 @@ module DL def bind_function(name, ctype, argtype, call_type = nil, &block) if DL.fiddle? - closure = Class.new(Fiddle::Closure) { + klass = Function.instance_eval { class_fiddle_closure_cfunc } + abi = Function.instance_eval { call_type_to_abi(call_type) } + closure = Class.new(klass) { define_method(:call, block) - }.new(ctype, argtype) + }.new(ctype, argtype, abi, name) - Function.new(closure, argtype) + Function.new(closure, argtype, abi) else f = Function.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype) f.bind(&block) |