diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 14:47:54 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 14:47:54 +0000 |
| commit | cb1f9532b7440d08cf0fc31edccb3605e8f455f1 (patch) | |
| tree | 6f1e9e05270dcbb19e81099398dde28d8f0d2b2c /ext | |
| parent | 868a02b6165bf4657e8c8729a90746eee60b5f02 (diff) | |
merges r23386 from trunk into ruby_1_9_1.
--
* ext/dl/lib/dl/func.rb (DL::Function#bound?): returns if already
bound to a block.
* ext/dl/lib/dl/value.rb (DL::ValueUtil#wrap_arg): block must be
given if arg is not bound. [ruby-dev:38404]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/dl/lib/dl/func.rb | 4 | ||||
| -rw-r--r-- | ext/dl/lib/dl/value.rb | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb index a2e6d40fb..f0e1ca71e 100644 --- a/ext/dl/lib/dl/func.rb +++ b/ext/dl/lib/dl/func.rb @@ -97,6 +97,10 @@ module DL end end + def bound?() + @cfunc.ptr != 0 + end + def bind_at_call(&block) bind(&block) end diff --git a/ext/dl/lib/dl/value.rb b/ext/dl/lib/dl/value.rb index aa7e0dd32..254e1921c 100644 --- a/ext/dl/lib/dl/value.rb +++ b/ext/dl/lib/dl/value.rb @@ -61,6 +61,8 @@ module DL if( block ) arg.bind_at_call(&block) funcs.push(arg) + elsif !arg.bound? + raise(RuntimeError, "block must be given.") end return arg.to_i when String |
