mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/Win32API/Win32API.c (Win32API_Call): disable global
optimization. fixed: [ruby-core:05143] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
10117968d4
commit
c538f75a51
3 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Jun 9 23:58:12 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/Win32API/Win32API.c (Win32API_Call): disable global
|
||||||
|
optimization. fixed: [ruby-core:05143]
|
||||||
|
|
||||||
Thu Jun 9 23:35:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Jun 9 23:35:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* enum.c (enum_inject): default the result value to Qundef to use
|
* enum.c (enum_inject): default the result value to Qundef to use
|
||||||
|
|
|
@ -53,12 +53,12 @@ Win32API_initialize(self, dllname, proc, import, export)
|
||||||
hdll = LoadLibrary(RSTRING(dllname)->ptr);
|
hdll = LoadLibrary(RSTRING(dllname)->ptr);
|
||||||
if (!hdll)
|
if (!hdll)
|
||||||
rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
|
rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
|
||||||
rb_iv_set(self, "__hdll__", Data_Wrap_Struct(rb_cData, 0, Win32API_FreeLibrary, hdll));
|
rb_iv_set(self, "__hdll__", Data_Wrap_Struct(rb_cData, 0, Win32API_FreeLibrary, (void*)hdll));
|
||||||
hproc = GetProcAddress(hdll, RSTRING(proc)->ptr);
|
hproc = (HANDLE)GetProcAddress(hdll, RSTRING(proc)->ptr);
|
||||||
if (!hproc) {
|
if (!hproc) {
|
||||||
str = rb_str_new3(proc);
|
str = rb_str_new3(proc);
|
||||||
str = rb_str_cat(str, "A", 1);
|
str = rb_str_cat(str, "A", 1);
|
||||||
hproc = GetProcAddress(hdll, RSTRING(str)->ptr);
|
hproc = (HANDLE)GetProcAddress(hdll, RSTRING(str)->ptr);
|
||||||
if (!hproc)
|
if (!hproc)
|
||||||
rb_raise(rb_eRuntimeError, "GetProcAddress: %s or %s\n",
|
rb_raise(rb_eRuntimeError, "GetProcAddress: %s or %s\n",
|
||||||
RSTRING(proc)->ptr, RSTRING(str)->ptr);
|
RSTRING(proc)->ptr, RSTRING(str)->ptr);
|
||||||
|
@ -137,6 +137,9 @@ Win32API_initialize(self, dllname, proc, import, export)
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma optimize("g", off)
|
||||||
|
#endif
|
||||||
static VALUE
|
static VALUE
|
||||||
Win32API_Call(argc, argv, obj)
|
Win32API_Call(argc, argv, obj)
|
||||||
int argc;
|
int argc;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
|
|
||||||
|
dir_config("win32")
|
||||||
if have_header("windows.h") and have_library("kernel32")
|
if have_header("windows.h") and have_library("kernel32")
|
||||||
create_makefile("Win32API")
|
create_makefile("Win32API")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue