summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-11 12:32:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-11 12:32:15 +0000
commit59a666a25f9c03320a5fcc5b576b86c3a87a9317 (patch)
tree1127cbbb39f5209e8ed953bc4ed340b0f16679c5 /lib
parent8a7aad995210ce7a66e9be4315693feb7756670a (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
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb11
1 files changed, 9 insertions, 2 deletions
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}