Mercurial > libavformat.hg
diff network.h @ 5516:afe4a96b6832 libavformat
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
Patch by Martin Storsj <$firstname()$firstname,st>.
author | rbultje |
---|---|
date | Mon, 11 Jan 2010 17:27:07 +0000 |
parents | 40c9bef5b4e2 |
children | 9faa86343583 |
line wrap: on
line diff
--- a/network.h Mon Jan 11 17:14:16 2010 +0000 +++ b/network.h Mon Jan 11 17:27:07 2010 +0000 @@ -68,4 +68,42 @@ int inet_aton (const char * str, struct in_addr * add); #endif +#if !HAVE_STRUCT_ADDRINFO +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + int ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +#endif + +/* getaddrinfo constants */ +#ifndef EAI_FAIL +#define EAI_FAIL 4 +#endif + +#ifndef AI_PASSIVE +#define AI_PASSIVE 1 +#endif + +#ifndef AI_CANONNAME +#define AI_CANONNAME 2 +#endif + +#ifndef AI_NUMERICHOST +#define AI_NUMERICHOST 4 +#endif + +#if !HAVE_GETADDRINFO +int ff_getaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, struct addrinfo **res); +void ff_freeaddrinfo(struct addrinfo *res); +#define getaddrinfo ff_getaddrinfo +#define freeaddrinfo ff_freeaddrinfo +#endif + #endif /* AVFORMAT_NETWORK_H */