diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-12 17:36:24 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-12 17:36:24 +0000 |
commit | 784da4426fb0e1a869598f2d68296aca77dc229d (patch) | |
tree | 7f3dfa9e28b79d11a35005ebf56341abcb05c11a | |
parent | e987a0eeeede296658f7c4b82bc184077be305c6 (diff) | |
download | ruby-784da4426fb0e1a869598f2d68296aca77dc229d.tar.gz ruby-784da4426fb0e1a869598f2d68296aca77dc229d.tar.xz ruby-784da4426fb0e1a869598f2d68296aca77dc229d.zip |
* ext/dl/lib/dl/win32.rb: elimitate unnecessary "A" adding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ext/dl/lib/dl/win32.rb | 8 |
2 files changed, 6 insertions, 6 deletions
@@ -1,3 +1,7 @@ +Mon Jan 13 02:22:11 2003 WATANABE Hirofumi <eban@ruby-lang.org> + + * ext/dl/lib/dl/win32.rb: elimitate unnecessary "A" adding. + Sun Jan 12 16:07:17 2003 WATANABE Hirofumi <eban@ruby-lang.org> * io.c (next_argv): inherit binmode from $defout. diff --git a/ext/dl/lib/dl/win32.rb b/ext/dl/lib/dl/win32.rb index f0ea2a91e..8077656ab 100644 --- a/ext/dl/lib/dl/win32.rb +++ b/ext/dl/lib/dl/win32.rb @@ -8,15 +8,11 @@ class Win32API def initialize(dllname, func, import, export = "0") prototype = (export + import.to_s).tr("VPpNnLlIi", "0SSI") handle = DLL[dllname] ||= DL::Handle.new(dllname) - begin - @sym = handle.sym(func, prototype) - rescue RuntimeError - @sym = handle.sym(func + "A", prototype) - end + @sym = handle.sym(func, prototype) end def call(*args) - import = @sym.proto[1..-1] || "" + import = @sym.split("", 2)[1] args.each_with_index do |x, i| args[i] = nil if x == 0 and import[i] == ?S args[i], = [x].pack("I").unpack("i") if import[i] == ?I |