summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--ext/win32/lib/Win32API.rb6
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7976d045bb..dafcd88cd3 100644
--- a/ChangeLog
+++ b/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>
* lib/securerandom.rb (SecureRandom.random_bytes): use fiddle directly
diff --git a/ext/win32/lib/Win32API.rb b/ext/win32/lib/Win32API.rb
index 2e2b441940..8589768e64 100644
--- a/ext/win32/lib/Win32API.rb
+++ b/ext/win32/lib/Win32API.rb
@@ -2,7 +2,7 @@
# for backward compatibility
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
DLL = {}
@@ -15,9 +15,9 @@ class Win32API
@func = Fiddle::Function.new(
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")],
- Fiddle::Importer::CALL_TYPE_TO_ABI[calltype]
+ Fiddle::Importer.const_get(:CALL_TYPE_TO_ABI)[calltype]
)
rescue Fiddle::DLError => e
raise LoadError, e.message, e.backtrace