Mercurial > libavformat.hg
changeset 5638:a3e321e7ca38 libavformat
Implement gai_strerror() for systems lacking such functionality. Patch
by KO Myung-Hun <komh challion net>.
author | rbultje |
---|---|
date | Mon, 08 Feb 2010 18:48:12 +0000 |
parents | 37e2c3e635b3 |
children | 829780403fc6 |
files | network.h os_support.c |
diffstat | 2 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/network.h Mon Feb 08 10:13:03 2010 +0000 +++ b/network.h Mon Feb 08 18:48:12 2010 +0000 @@ -147,9 +147,11 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen, char *host, int hostlen, char *serv, int servlen, int flags); +const char *ff_gai_strerror(int ecode); #define getaddrinfo ff_getaddrinfo #define freeaddrinfo ff_freeaddrinfo #define getnameinfo ff_getnameinfo +#define gai_strerror ff_gai_strerror #endif #endif /* AVFORMAT_NETWORK_H */
--- a/os_support.c Mon Feb 08 10:13:03 2010 +0000 +++ b/os_support.c Mon Feb 08 18:48:12 2010 +0000 @@ -203,6 +203,17 @@ return 0; } + +const char *ff_gai_strerror(int ecode) +{ + switch(ecode) { + case EAI_FAIL : return "A non-recoverable error occurred"; + case EAI_FAMILY : return "The address family was not recognized or the address length was invalid for the specified family"; + case EAI_NONAME : return "The name does not resolve for the supplied parameters"; + } + + return "Unknown error"; +} #endif /* resolve host with also IP address parsing */