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 | 6fac4c5f9f994a0eb95281e79b27a01bc4e6bf29 (patch) | |
tree | 6f1e9e05270dcbb19e81099398dde28d8f0d2b2c | |
parent | a5892c11485a36a89266bee7e3b2de5360bd53e6 (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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ext/dl/lib/dl/func.rb | 4 | ||||
-rw-r--r-- | ext/dl/lib/dl/value.rb | 2 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 14 insertions, 2 deletions
@@ -1,4 +1,4 @@ -Sun May 10 11:13:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> +Sun May 10 11:36:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if the argument is an instance of DL::CFunc. @@ -9,6 +9,12 @@ Sun May 10 11:13:19 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_signature): strips spaces. based on a patch from Takashi Tamura in [ruby-dev:38398]. + * ext/dl/lib/dl/value.rb (DL::ValueUtil#wrap_arg): block must be + given if arg is not bound. [ruby-dev:38404] + + * ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if + the argument is an instance of DL::CFunc. + Sat May 9 11:14:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * vm_eval.c (rb_f_catch): gets rid of issue with gcc 4.4. a patch diff --git a/ext/dl/lib/dl/func.rb b/ext/dl/lib/dl/func.rb index a2e6d40fbe..f0e1ca71ee 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 aa7e0dd325..254e1921ce 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 @@ -1,6 +1,6 @@ #define RUBY_VERSION "1.9.1" #define RUBY_RELEASE_DATE "2009-05-12" -#define RUBY_PATCHLEVEL 136 +#define RUBY_PATCHLEVEL 137 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |