[前][次][番号順一覧][スレッド一覧]

ruby-changes:43433

From: nobu <ko1@a...>
Date: Sun, 26 Jun 2016 10:20:35 +0900 (JST)
Subject: [ruby-changes:43433] nobu:r55507 (trunk): Explicit ".dll" suffix

nobu	2016-06-26 10:20:27 +0900 (Sun, 26 Jun 2016)

  New Revision: 55507

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55507

  Log:
    Explicit ".dll" suffix
    
    * ext/win32/lib/Win32API.rb (Win32API#initialize): Cygwin
      2.5.2-1 (perhaps) seems to no longer append ".dll" suffix
      implicitly.
    * ext/win32/lib/win32/resolv.rb (Win32::Resolv): ditto.  Fix the
      error reported by yamataka AT u08.itscom.net in
      [ruby-list:50339], and pointed out and patched by cerberus AT
      m3.kcn.ne.jp in [ruby-list:50341].

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32/lib/Win32API.rb
    trunk/ext/win32/lib/win32/resolv.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55506)
+++ ChangeLog	(revision 55507)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jun 26 10:20:25 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/win32/lib/Win32API.rb (Win32API#initialize): Cygwin
+	  2.5.2-1 (perhaps) seems to no longer append ".dll" suffix
+	  implicitly.
+
+	* ext/win32/lib/win32/resolv.rb (Win32::Resolv): ditto.  Fix the
+	  error reported by yamataka AT u08.itscom.net in
+	  [ruby-list:50339], and pointed out and patched by cerberus AT
+	  m3.kcn.ne.jp in [ruby-list:50341].
+
 Sat Jun 25 10:07:52 2016  Kazuki Yamaguchi  <k@r...>
 
 	* test/openssl/test_ocsp.rb: Ignore errors caused by bugs that exist in
Index: ext/win32/lib/Win32API.rb
===================================================================
--- ext/win32/lib/Win32API.rb	(revision 55506)
+++ ext/win32/lib/Win32API.rb	(revision 55507)
@@ -12,7 +12,13 @@ class Win32API https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/Win32API.rb#L12
 
   def initialize(dllname, func, import, export = "0", calltype = :stdcall)
     @proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
-    handle = DLL[dllname] ||= Fiddle.dlopen(dllname)
+    handle = DLL[dllname] ||=
+             begin
+               Fiddle.dlopen(dllname)
+             rescue Fiddle::DLError
+               raise unless File.extname(dllname).empty?
+               Fiddle.dlopen(dllname + ".dll")
+             end
 
     @func = Fiddle::Function.new(
       handle[func],
Index: ext/win32/lib/win32/resolv.rb
===================================================================
--- ext/win32/lib/win32/resolv.rb	(revision 55506)
+++ ext/win32/lib/win32/resolv.rb	(revision 55507)
@@ -38,7 +38,7 @@ module Win32 https://github.com/ruby/ruby/blob/trunk/ext/win32/lib/win32/resolv.rb#L38
 nt = Module.new do
   break true if [nil].pack("p").size > 4
   extend Importer
-  dlload "kernel32"
+  dlload "kernel32.dll"
   getv = extern "int GetVersionExA(void *)", :stdcall
   info = [ 148, 0, 0, 0, 0 ].pack('V5') + "\0" * 128
   getv.call(info)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]