diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-11 12:32:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-11 12:32:15 +0000 |
commit | 59a666a25f9c03320a5fcc5b576b86c3a87a9317 (patch) | |
tree | 1127cbbb39f5209e8ed953bc4ed340b0f16679c5 | |
parent | 8a7aad995210ce7a66e9be4315693feb7756670a (diff) |
* lib/mkmf.rb (try_func): accept variable address.
* ext/win32ole/extconf.rb: libuuid is needed on cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ext/win32ole/extconf.rb | 10 | ||||
-rw-r--r-- | lib/mkmf.rb | 11 |
3 files changed, 23 insertions, 4 deletions
@@ -1,3 +1,9 @@ +Thu Nov 11 21:32:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@ruby-lang.org> * file.c (file_expand_path): use cygwin_conv_path on cygwin 1.7 or diff --git a/ext/win32ole/extconf.rb b/ext/win32ole/extconf.rb index 893793382b..95f229b041 100644 --- a/ext/win32ole/extconf.rb +++ b/ext/win32ole/extconf.rb @@ -4,7 +4,13 @@ #---------------------------------- 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 @@ -19,7 +25,7 @@ end 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 diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 4b196565ee..fc6bd08db4 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -583,13 +583,20 @@ end # 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} |