ruby-changes:38446
From: nobu <ko1@a...>
Date: Mon, 18 May 2015 15:32:28 +0900 (JST)
Subject: [ruby-changes:38446] nobu:r50527 (trunk): intern.h: rb_f_notimplement for ext on Windows
nobu 2015-05-18 15:31:42 +0900 (Mon, 18 May 2015) New Revision: 50527 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50527 Log: intern.h: rb_f_notimplement for ext on Windows * include/ruby/intern.h (rb_f_notimplement): should not respond to not-implemented methods. as the address inside a DLL and the imported address are different on Windows, use an exported variable to share the same address. Modified files: trunk/ChangeLog trunk/include/ruby/intern.h trunk/test/-ext-/test_notimplement.rb trunk/win32/win32.c Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 50526) +++ include/ruby/intern.h (revision 50527) @@ -401,6 +401,10 @@ VALUE rb_eval_cmd(VALUE, VALUE, int); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L401 int rb_obj_respond_to(VALUE, ID, int); int rb_respond_to(VALUE, ID); VALUE rb_f_notimplement(int argc, const VALUE *argv, VALUE obj); +#if !defined(RUBY_EXPORT) && defined(_WIN32) +RUBY_EXTERN VALUE (*const rb_f_notimplement_)(int, const VALUE *, VALUE); +#define rb_f_notimplement (*rb_f_notimplement_) +#endif void rb_interrupt(void); VALUE rb_apply(VALUE, ID, VALUE); void rb_backtrace(void); Index: ChangeLog =================================================================== --- ChangeLog (revision 50526) +++ ChangeLog (revision 50527) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon May 18 15:31:31 2015 Nobuyoshi Nakada <nobu@r...> + + * include/ruby/intern.h (rb_f_notimplement): should not respond to + not-implemented methods. as the address inside a DLL and the + imported address are different on Windows, use an exported + variable to share the same address. + Mon May 18 13:55:01 2015 Shugo Maeda <shugo@r...> * lib/monitor.rb (mon_try_enter, mon_enter): should reset @mon_count Index: win32/win32.c =================================================================== --- win32/win32.c (revision 50526) +++ win32/win32.c (revision 50527) @@ -7356,6 +7356,8 @@ rb_w32_pow(double x, double y) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L7356 } #endif +VALUE (*const rb_f_notimplement_)(int, const VALUE *, VALUE) = rb_f_notimplement; + #if RUBY_MSVCRT_VERSION < 120 #include "missing/nextafter.c" #endif Index: test/-ext-/test_notimplement.rb =================================================================== --- test/-ext-/test_notimplement.rb (revision 50526) +++ test/-ext-/test_notimplement.rb (revision 50527) @@ -7,4 +7,8 @@ class TestNotImplement < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/-ext-/test_notimplement.rb#L7 Bug.funcall(:notimplement) } end + + def test_respond_to + assert_not_respond_to(Bug, :notimplement) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/