mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/win32/lib/Win32API.rb: Fiddle::Importer is defined in
fiddle/import.rb and it's not loaded implicitly. * ext/win32/lib/Win32API.rb (Win32API#initialize): `import` is a string. * ext/win32/lib/Win32API.rb (Win32API#initialize): Fiddle::Importer::CALL_TYPE_TO_ABI is private constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
07f460829a
commit
2e5610353f
2 changed files with 13 additions and 3 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,3 +1,13 @@
|
||||||
|
Tue Nov 4 21:23:22 2014 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/win32/lib/Win32API.rb: Fiddle::Importer is defined in
|
||||||
|
fiddle/import.rb and it's not loaded implicitly.
|
||||||
|
|
||||||
|
* ext/win32/lib/Win32API.rb (Win32API#initialize): `import` is a string.
|
||||||
|
|
||||||
|
* ext/win32/lib/Win32API.rb (Win32API#initialize):
|
||||||
|
Fiddle::Importer::CALL_TYPE_TO_ABI is private constant.
|
||||||
|
|
||||||
Tue Nov 4 21:20:07 2014 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue Nov 4 21:20:07 2014 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* lib/securerandom.rb (SecureRandom.random_bytes): use fiddle directly
|
* lib/securerandom.rb (SecureRandom.random_bytes): use fiddle directly
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# for backward compatibility
|
# for backward compatibility
|
||||||
warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead" if $VERBOSE
|
warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead" if $VERBOSE
|
||||||
|
|
||||||
require 'fiddle'
|
require 'fiddle/import'
|
||||||
|
|
||||||
class Win32API
|
class Win32API
|
||||||
DLL = {}
|
DLL = {}
|
||||||
|
|
@ -15,9 +15,9 @@ class Win32API
|
||||||
|
|
||||||
@func = Fiddle::Function.new(
|
@func = Fiddle::Function.new(
|
||||||
handle[func],
|
handle[func],
|
||||||
import.map { |win_type| TYPEMAP[win_type.tr("VPpNnLlIi", "0SSI")] },
|
import.chars.map { |win_type| TYPEMAP[win_type.tr("VPpNnLlIi", "0SSI")] },
|
||||||
TYPEMAP[export.tr("VPpNnLlIi", "0SSI")],
|
TYPEMAP[export.tr("VPpNnLlIi", "0SSI")],
|
||||||
Fiddle::Importer::CALL_TYPE_TO_ABI[calltype]
|
Fiddle::Importer.const_get(:CALL_TYPE_TO_ABI)[calltype]
|
||||||
)
|
)
|
||||||
rescue Fiddle::DLError => e
|
rescue Fiddle::DLError => e
|
||||||
raise LoadError, e.message, e.backtrace
|
raise LoadError, e.message, e.backtrace
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue