1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/fiddle] Add workaround for RubyInstaller for Windows

See comment for details.

0c76f03dc4
This commit is contained in:
Sutou Kouhei 2020-08-15 13:19:23 +09:00 committed by Sutou Kouhei
parent 307388ea19
commit aff5eaced4
Notes: git 2020-11-18 09:05:46 +09:00

View file

@ -141,6 +141,20 @@ Init_fiddle(void)
*/
rb_eFiddleError = rb_define_class_under(mFiddle, "Error", rb_eStandardError);
/*
* Ruby installed by RubyInstaller for Windows always require
* bundled Fiddle because ruby_installer/runtime/dll_directory.rb
* requires Fiddle. It's used by
* rubygems/defaults/operating_system.rb. It means that the
* bundled Fiddle is always required on initialization.
*
* We just remove existing Fiddle::DLError here to override
* the bundled Fiddle.
*/
if (rb_const_defined(mFiddle, rb_intern("DLError"))) {
rb_const_remove(mFiddle, rb_intern("DLError"));
}
/*
* Document-class: Fiddle::DLError
*