summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-09 14:59:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-09 14:59:10 +0000
commit9b054940c560619fa4213c114163739d7c6f576c (patch)
treebe721d8f72353b55c4662e00b0c7761542ebcd61
parentcfe575f06bbe5a42493ae92defc0201a53764679 (diff)
downloadruby-9b054940c560619fa4213c114163739d7c6f576c.tar.gz
ruby-9b054940c560619fa4213c114163739d7c6f576c.tar.xz
ruby-9b054940c560619fa4213c114163739d7c6f576c.zip
* ext/Win32API/Win32API.c (Win32API_Call): disable global
optimization. fixed: [ruby-core:05143] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/Win32API/Win32API.c9
-rw-r--r--ext/Win32API/extconf.rb1
3 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 70d10cff3..07cc5888b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* enum.c (enum_inject): default the result value to Qundef to use
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
index be07b8504..96ce8c663 100644
--- a/ext/Win32API/Win32API.c
+++ b/ext/Win32API/Win32API.c
@@ -53,12 +53,12 @@ Win32API_initialize(self, dllname, proc, import, export)
hdll = LoadLibrary(RSTRING(dllname)->ptr);
if (!hdll)
rb_raise(rb_eRuntimeError, "LoadLibrary: %s\n", RSTRING(dllname)->ptr);
- rb_iv_set(self, "__hdll__", Data_Wrap_Struct(rb_cData, 0, Win32API_FreeLibrary, hdll));
- hproc = GetProcAddress(hdll, RSTRING(proc)->ptr);
+ rb_iv_set(self, "__hdll__", Data_Wrap_Struct(rb_cData, 0, Win32API_FreeLibrary, (void*)hdll));
+ hproc = (HANDLE)GetProcAddress(hdll, RSTRING(proc)->ptr);
if (!hproc) {
str = rb_str_new3(proc);
str = rb_str_cat(str, "A", 1);
- hproc = GetProcAddress(hdll, RSTRING(str)->ptr);
+ hproc = (HANDLE)GetProcAddress(hdll, RSTRING(str)->ptr);
if (!hproc)
rb_raise(rb_eRuntimeError, "GetProcAddress: %s or %s\n",
RSTRING(proc)->ptr, RSTRING(str)->ptr);
@@ -137,6 +137,9 @@ Win32API_initialize(self, dllname, proc, import, export)
return Qnil;
}
+#ifdef _MSC_VER
+#pragma optimize("g", off)
+#endif
static VALUE
Win32API_Call(argc, argv, obj)
int argc;
diff --git a/ext/Win32API/extconf.rb b/ext/Win32API/extconf.rb
index 134a6e5b9..865788556 100644
--- a/ext/Win32API/extconf.rb
+++ b/ext/Win32API/extconf.rb
@@ -1,5 +1,6 @@
require 'mkmf'
+dir_config("win32")
if have_header("windows.h") and have_library("kernel32")
create_makefile("Win32API")
end