* ext/fiddle/*: Adding fiddle library to wrap libffi

* test/fiddle/*: testing fiddle extension
* ext/dl/lib/dl.rb: Requiring fiddle if it is available
* ext/dl/lib/dl/callback.rb: using Fiddle if it is available
* ext/dl/lib/dl/func.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2010-05-06 06:59:24 +00:00
parent ca3c007f05
commit 4bada8b864
22 changed files with 1084 additions and 71 deletions

View file

@ -0,0 +1,17 @@
module Fiddle
class Closure
attr_reader :ctype
attr_reader :args
class BlockCaller < Fiddle::Closure
def initialize ctype, args, abi = Fiddle::Function::DEFAULT, &block
super(ctype, args, abi)
@block = block
end
def call *args
@block.call(*args)
end
end
end
end

View file

@ -0,0 +1,5 @@
module Fiddle
class Function
attr_reader :abi
end
end