Skip to content

Commit

Permalink
[ruby/fiddle] Add workaround for RubyInstaller for Windows
Browse files Browse the repository at this point in the history
See comment for details.

ruby/fiddle@0c76f03dc4
  • Loading branch information
kou committed Nov 18, 2020
1 parent 307388e commit aff5eac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ext/fiddle/fiddle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit aff5eac

Please sign in to comment.