mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/dl/win32/lib/Win32API.rb: call by :stdcall as default.
[ruby-core:22826] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a41bd7f51
commit
df63af6be2
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Mar 11 17:26:38 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/dl/win32/lib/Win32API.rb: call by :stdcall as default.
|
||||||
|
[ruby-core:22826]
|
||||||
|
|
||||||
Wed Mar 11 13:27:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Mar 11 13:27:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (stack_type): uses VALUE which is able to be stored
|
* parse.y (stack_type): uses VALUE which is able to be stored
|
||||||
|
|
|
@ -8,10 +8,10 @@ class Win32API
|
||||||
DLL = {}
|
DLL = {}
|
||||||
TYPEMAP = {"0" => DL::TYPE_VOID, "S" => DL::TYPE_VOIDP, "I" => DL::TYPE_LONG}
|
TYPEMAP = {"0" => DL::TYPE_VOID, "S" => DL::TYPE_VOIDP, "I" => DL::TYPE_LONG}
|
||||||
|
|
||||||
def initialize(dllname, func, import, export = "0", *rest)
|
def initialize(dllname, func, import, export = "0", calltype = :stdcall)
|
||||||
@proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
|
@proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
|
||||||
handle = DLL[dllname] ||= DL.dlopen(dllname)
|
handle = DLL[dllname] ||= DL.dlopen(dllname)
|
||||||
@func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func, *rest)
|
@func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func, calltype)
|
||||||
rescue DL::DLError => e
|
rescue DL::DLError => e
|
||||||
raise LoadError, e.message, e.backtrace
|
raise LoadError, e.message, e.backtrace
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue