mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									e0915ba679
								
							
						
					
					
						commit
						8413749ec0
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue