summaryrefslogtreecommitdiff
path: root/ext/dl/lib/dl/import.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-25 22:49:20 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-25 22:49:20 +0000
commit59e4e93ef7b6b7f1536e3c56374cc6b8d74b5d28 (patch)
tree8ef0ee021c12e0ff884aaa2cc963845ab61fa41e /ext/dl/lib/dl/import.rb
parent9d818a221ec86fb15bfe696995829807be49a1da (diff)
* ext/dl: revert dl with libffi because it can't run on mswin now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/lib/dl/import.rb')
-rw-r--r--ext/dl/lib/dl/import.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/dl/lib/dl/import.rb b/ext/dl/lib/dl/import.rb
index 4c101d0f5c..199354c18e 100644
--- a/ext/dl/lib/dl/import.rb
+++ b/ext/dl/lib/dl/import.rb
@@ -1,5 +1,4 @@
require 'dl'
-require 'dl/closure'
require 'dl/func.rb'
require 'dl/struct.rb'
require 'dl/cparser.rb'
@@ -212,11 +211,9 @@ module DL
end
def bind_function(name, ctype, argtype, call_type = nil, &block)
- closure = Class.new(DL::Closure) {
- define_method(:call, block)
- }.new(ctype, argtype)
-
- Function.new(closure, argtype)
+ f = Function.new(CFunc.new(0, ctype, name, call_type || :cdecl), argtype)
+ f.bind(&block)
+ f
end
def create_temp_function(name, ctype, argtype, call_type = nil)