From 59a666a25f9c03320a5fcc5b576b86c3a87a9317 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 11 Nov 2010 12:32:15 +0000 Subject: * 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 --- lib/mkmf.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib') 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} -- cgit v1.2.3