diff options
author | Martin Storsjö <martin@martin.st> | 2010-01-11 17:27:07 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2010-01-11 17:27:07 +0000 |
commit | fa053ca725358e728f6ad70f01be7a4dedeebd57 (patch) | |
tree | a9c47640db1f72c5539d29020b31709146209722 /libavformat/network.h | |
parent | c0018613513f283138e3afa7dc5438993d635bea (diff) | |
download | ffmpeg-fa053ca725358e728f6ad70f01be7a4dedeebd57.tar.gz |
Provide fallback implementations of getaddrinfo() and freeaddrinfo().
Patch by Martin Storsjö <$firstname()$firstname,st>.
Originally committed as revision 21145 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/network.h')
-rw-r--r-- | libavformat/network.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libavformat/network.h b/libavformat/network.h index 7af77991d4..43c2544031 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -68,4 +68,42 @@ static inline void ff_network_close(void) 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 */ |