diff --git a/win32/mkexports.rb b/win32/mkexports.rb index 3c535211a9..70b7f3f228 100755 --- a/win32/mkexports.rb +++ b/win32/mkexports.rb @@ -9,14 +9,11 @@ end class Exports PrivateNames = /(?:Init_|InitVM_|ruby_static_id_|threadptr|_ec_|DllMain\b)/ - @@subclass = [] - def self.inherited(klass) - @@subclass << [/#{klass.name.sub(/.*::/, '').downcase}/i, klass] - end - def self.create(*args, &block) platform = RUBY_PLATFORM - pat, klass = @@subclass.find {|p, k| p =~ platform} + klass = constants.find do |p| + break const_get(p) if platform.include?(p.to_s.downcase) + end unless klass raise ArgumentError, "unsupported platform: #{platform}" end