1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merges r30407 and r30450 from trunk into ruby_1_9_2.

--
* ext/fiddle/extconf.rb: check for windows.h while building fiddle.
  Thanks Jon Forums! [ruby-core:33923]
--
* Use _WIN32 rather than checking for windows.h.  Thanks Jon Forums!
  [ruby-core:33977]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2011-01-16 06:30:33 +00:00
parent 27f15990ad
commit 66fd410332
9 changed files with 31 additions and 11 deletions

View file

@ -25,7 +25,7 @@ rb_dl_set_last_error(VALUE self, VALUE val)
return Qnil;
}
#if defined(HAVE_WINDOWS_H)
#if defined(_WIN32)
#include <windows.h>
static ID id_win32_last_error;
@ -578,7 +578,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
}
rb_dl_set_last_error(self, INT2NUM(errno));
#if defined(HAVE_WINDOWS_H)
#if defined(_WIN32)
rb_dl_set_win32_last_error(self, INT2NUM(GetLastError()));
#endif
@ -607,13 +607,13 @@ void
Init_dlcfunc(void)
{
id_last_error = rb_intern("__DL2_LAST_ERROR__");
#if defined(HAVE_WINDOWS_H)
#if defined(_WIN32)
id_win32_last_error = rb_intern("__DL2_WIN32_LAST_ERROR__");
#endif
rb_cDLCFunc = rb_define_class_under(rb_mDL, "CFunc", rb_cObject);
rb_define_alloc_func(rb_cDLCFunc, rb_dlcfunc_s_allocate);
rb_define_module_function(rb_cDLCFunc, "last_error", rb_dl_get_last_error, 0);
#if defined(HAVE_WINDOWS_H)
#if defined(_WIN32)
rb_define_module_function(rb_cDLCFunc, "win32_last_error", rb_dl_get_win32_last_error, 0);
#endif
rb_define_method(rb_cDLCFunc, "initialize", rb_dlcfunc_initialize, -1);