зеркало из https://github.com/github/ruby.git
ext/socket/extconf.rb: Fix the chech if if_indextoname is available
The check had not work because "headers" were not passed.
This commit is contained in:
Родитель
e0915ba679
Коммит
8413749ec0
|
@ -484,6 +484,9 @@ EOF
|
|||
have_func("getpeerucred(0, (ucred_t **)NULL)", headers) # SunOS
|
||||
|
||||
have_func_decl = proc do |name, headers|
|
||||
# check if there is a declaration of <name> by trying to declare
|
||||
# both "int <name>(void)" and "void <name>(void)"
|
||||
# (at least one attempt should fail if there is a declaration)
|
||||
if !checking_for("declaration of #{name}()") {!%w[int void].all? {|ret| try_compile(<<EOF)}}
|
||||
#{cpp_include(headers)}
|
||||
#{ret} #{name}(void);
|
||||
|
@ -492,10 +495,10 @@ EOF
|
|||
end
|
||||
end
|
||||
if have_func('if_indextoname(0, "")', headers)
|
||||
have_func_decl["if_indextoname"]
|
||||
have_func_decl["if_indextoname", headers]
|
||||
end
|
||||
if have_func('if_nametoindex("")', headers)
|
||||
have_func_decl["if_nametoindex"]
|
||||
have_func_decl["if_nametoindex", headers]
|
||||
end
|
||||
|
||||
have_func("hsterror", headers)
|
||||
|
|
Загрузка…
Ссылка в новой задаче