Test HAVE_GETNAMEINFO definition before using GETNAMEINFO_XXX definitions.
This commit is contained in:
		@@ -196,6 +196,7 @@ int curl_dogetaddrinfo(char *hostname, char *service,
 | 
				
			|||||||
                       struct addrinfo *hints,
 | 
					                       struct addrinfo *hints,
 | 
				
			||||||
                       struct addrinfo **result,
 | 
					                       struct addrinfo **result,
 | 
				
			||||||
                       int line, const char *source);
 | 
					                       int line, const char *source);
 | 
				
			||||||
 | 
					#ifdef HAVE_GETNAMEINFO
 | 
				
			||||||
int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
 | 
					int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
 | 
				
			||||||
                       GETNAMEINFO_TYPE_ARG2 salen,
 | 
					                       GETNAMEINFO_TYPE_ARG2 salen,
 | 
				
			||||||
                       char *host, GETNAMEINFO_TYPE_ARG46 hostlen,
 | 
					                       char *host, GETNAMEINFO_TYPE_ARG46 hostlen,
 | 
				
			||||||
@@ -203,6 +204,7 @@ int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
 | 
				
			|||||||
                       GETNAMEINFO_TYPE_ARG7 flags,
 | 
					                       GETNAMEINFO_TYPE_ARG7 flags,
 | 
				
			||||||
                       int line, const char *source);
 | 
					                       int line, const char *source);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* This is the callback function that is used when we build with asynch
 | 
					/* This is the callback function that is used when we build with asynch
 | 
				
			||||||
   resolve, ipv4 */
 | 
					   resolve, ipv4 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -136,6 +136,7 @@ int curl_dogetaddrinfo(char *hostname, char *service,
 | 
				
			|||||||
  return res;
 | 
					  return res;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_GETNAMEINFO
 | 
				
			||||||
int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
 | 
					int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
 | 
				
			||||||
                       GETNAMEINFO_TYPE_ARG2 salen,
 | 
					                       GETNAMEINFO_TYPE_ARG2 salen,
 | 
				
			||||||
                       char *host, GETNAMEINFO_TYPE_ARG46 hostlen,
 | 
					                       char *host, GETNAMEINFO_TYPE_ARG46 hostlen,
 | 
				
			||||||
@@ -160,6 +161,7 @@ int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa,
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  return res;
 | 
					  return res;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void curl_dofreeaddrinfo(struct addrinfo *freethis,
 | 
					void curl_dofreeaddrinfo(struct addrinfo *freethis,
 | 
				
			||||||
                         int line, const char *source)
 | 
					                         int line, const char *source)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,10 +96,14 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
 | 
				
			|||||||
#define getaddrinfo(host,serv,hint,res) \
 | 
					#define getaddrinfo(host,serv,hint,res) \
 | 
				
			||||||
  curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
 | 
					  curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_GETNAMEINFO
 | 
				
			||||||
#undef getnameinfo
 | 
					#undef getnameinfo
 | 
				
			||||||
#define getnameinfo(sa,salen,host,hostlen,serv,servlen,flags) \
 | 
					#define getnameinfo(sa,salen,host,hostlen,serv,servlen,flags) \
 | 
				
			||||||
  curl_dogetnameinfo(sa,salen,host,hostlen,serv,servlen,flags, __LINE__, \
 | 
					  curl_dogetnameinfo(sa,salen,host,hostlen,serv,servlen,flags, __LINE__, \
 | 
				
			||||||
  __FILE__)
 | 
					  __FILE__)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#undef freeaddrinfo
 | 
					#undef freeaddrinfo
 | 
				
			||||||
#define freeaddrinfo(data) \
 | 
					#define freeaddrinfo(data) \
 | 
				
			||||||
  curl_dofreeaddrinfo(data,__LINE__,__FILE__)
 | 
					  curl_dofreeaddrinfo(data,__LINE__,__FILE__)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user