summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-19 23:35:39 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-19 23:35:39 (GMT)
commiteb02a846a446e87df079956354387d4a83704d50 (patch)
treee3d807a5a04f38643a0dd41509cdb1c1875ee16a /ext/fiddle
parent9090241e614d3c5b302b713041164e27929f8898 (diff)
fiddle/import.rb: suppress warning
* ext/fiddle/lib/fiddle/import.rb: suppress exception report when $DEBUG is enabled. [ruby-core:86536] [Bug #14686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/lib/fiddle/import.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/fiddle/lib/fiddle/import.rb b/ext/fiddle/lib/fiddle/import.rb
index ae44914..178ebb8 100644
--- a/ext/fiddle/lib/fiddle/import.rb
+++ b/ext/fiddle/lib/fiddle/import.rb
@@ -157,7 +157,8 @@ module Fiddle
# :stopdoc:
CALL_TYPE_TO_ABI = Hash.new { |h, k|
raise RuntimeError, "unsupported call type: #{k}"
- }.merge({ :stdcall => (Function::STDCALL rescue Function::DEFAULT),
+ }.merge({ :stdcall => Function.const_defined?(:STDCALL) ? Function::STDCALL :
+ Function::DEFAULT,
:cdecl => Function::DEFAULT,
nil => Function::DEFAULT
}).freeze