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

ruby-changes:17735

From: nobu <ko1@a...>
Date: Thu, 11 Nov 2010 21:32:21 +0900 (JST)
Subject: [ruby-changes:17735] Ruby:r29746 (trunk): * lib/mkmf.rb (try_func): accept variable address.

nobu	2010-11-11 21:32:15 +0900 (Thu, 11 Nov 2010)

  New Revision: 29746

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29746

  Log:
    * lib/mkmf.rb (try_func): accept variable address.
    * ext/win32ole/extconf.rb: libuuid is needed on cygwin.

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/extconf.rb
    trunk/lib/mkmf.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29745)
+++ ChangeLog	(revision 29746)
@@ -1,3 +1,9 @@
+Thu Nov 11 21:32:09 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/mkmf.rb (try_func): accept variable address.
+
+	* ext/win32ole/extconf.rb: libuuid is needed on cygwin.
+
 Thu Nov 11 21:24:36 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (file_expand_path): use cygwin_conv_path on cygwin 1.7 or
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 29745)
+++ lib/mkmf.rb	(revision 29746)
@@ -583,13 +583,20 @@
 #             names of header files.
 def try_func(func, libs, headers = nil, &b)
   headers = cpp_include(headers)
+  case func
+  when /^&/
+    decltype = proc {|x|"const volatile void *#{x}"}
+  else
+    call = true
+    decltype = proc {|x| "void ((*#{x})())"}
+  end
   try_link(<<"SRC", libs, &b) or
 #{headers}
 /*top*/
 #{MAIN_DOES_NOTHING}
-int t() { void ((*volatile p)()); p = (void ((*)()))#{func}; return 0; }
+int t() { #{decltype["volatile p"]}; p = (#{decltype[]})#{func}; return 0; }
 SRC
-  try_link(<<"SRC", libs, &b)
+  call && try_link(<<"SRC", libs, &b)
 #{headers}
 /*top*/
 #{MAIN_DOES_NOTHING}
Index: ext/win32ole/extconf.rb
===================================================================
--- ext/win32ole/extconf.rb	(revision 29745)
+++ ext/win32ole/extconf.rb	(revision 29746)
@@ -4,8 +4,14 @@
 #----------------------------------
 require 'mkmf'
 
-dir_config("win32")
+case RUBY_PLATFORM
+when /cygwin/
+  inc = nil
+  lib = '/usr/lib/w32api'
+end
 
+dir_config("win32", inc, lib)
+
 SRCFILES=<<SRC
 win32ole.c
 SRC
@@ -19,7 +25,7 @@
 def create_win32ole_makefile
   if have_library("ole32") and
      have_library("oleaut32") and
-     have_library("uuid") and
+     have_library("uuid", "&CLSID_CMultiLanguage", "mlang.h") and
      have_library("user32") and
      have_library("kernel32") and
      have_library("advapi32") and

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

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