Project

General

Profile

Bug #14686 » fiddle_import.rb.patch

Function.const_defined?(:STDCALL) - MSP-Greg (Greg L), 04/13/2018 01:00 AM

View differences:

ext/fiddle/lib/fiddle/import.rb
# :stopdoc:
CALL_TYPE_TO_ABI = Hash.new { |h, k|
raise RuntimeError, "unsupported call type: #{k}"
}.merge({ :stdcall => (Function::STDCALL rescue Function::DEFAULT),
}.merge({ :stdcall => defined?(Function::STDCALL) ? Function::STDCALL :
Function::DEFAULT,
:cdecl => Function::DEFAULT,
nil => Function::DEFAULT
}).freeze
(2-2/2)