Fix HAVE_DECL_RES_INIT conditionals.
HAVE_DECL_RES_INIT is generated using AC_CHECK_DECLS. tinc checks this
symbol using #ifdef, which is wrong because (according to autoconf docs)
the symbol is always defined, it's just set to zero if the check failed.
This broke the Windows build starting from
0b310bf406, because it introduced this
conditional in code that's not excluded from the Windows build.
			
			
This commit is contained in:
		
							parent
							
								
									4989362300
								
							
						
					
					
						commit
						43b41e9095
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		|  | @ -664,7 +664,7 @@ static bool add_listen_address(char *address, bool bindto) { | |||
| 	hint.ai_protocol = IPPROTO_TCP; | ||||
| 	hint.ai_flags = AI_PASSIVE; | ||||
| 
 | ||||
| #ifdef HAVE_DECL_RES_INIT | ||||
| #if HAVE_DECL_RES_INIT | ||||
| 	res_init(); | ||||
| #endif | ||||
| 	int err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai); | ||||
|  |  | |||
|  | @ -39,7 +39,7 @@ struct addrinfo *str2addrinfo(const char *address, const char *service, int sock | |||
| 	hint.ai_family = addressfamily; | ||||
| 	hint.ai_socktype = socktype; | ||||
| 
 | ||||
| #ifdef HAVE_DECL_RES_INIT | ||||
| #if HAVE_DECL_RES_INIT | ||||
| 	res_init(); | ||||
| #endif | ||||
| 	err = getaddrinfo(address, service, &hint, &ai); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue