Commit d718c236 authored by conrad's avatar conrad

Localize the #define _SVID_SOURCE needed for inet_aton() to os_support.c

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22284 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent fcfe9d05
...@@ -63,10 +63,7 @@ static inline void ff_network_close(void) ...@@ -63,10 +63,7 @@ static inline void ff_network_close(void)
#endif #endif
} }
#if !HAVE_INET_ATON int ff_inet_aton (const char * str, struct in_addr * add);
/* in os_support.c */
int inet_aton (const char * str, struct in_addr * add);
#endif
#if !HAVE_STRUCT_SOCKADDR_STORAGE #if !HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage { struct sockaddr_storage {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <strings.h> #include <strings.h>
int inet_aton (const char * str, struct in_addr * add) int ff_inet_aton (const char * str, struct in_addr * add)
{ {
unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0; unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
...@@ -58,6 +58,11 @@ int inet_aton (const char * str, struct in_addr * add) ...@@ -58,6 +58,11 @@ int inet_aton (const char * str, struct in_addr * add)
return 1; return 1;
} }
#else
int ff_inet_aton (const char * str, struct in_addr * add)
{
return inet_aton(str, add);
}
#endif /* !HAVE_INET_ATON */ #endif /* !HAVE_INET_ATON */
#if !HAVE_GETADDRINFO #if !HAVE_GETADDRINFO
...@@ -85,7 +90,7 @@ int ff_getaddrinfo(const char *node, const char *service, ...@@ -85,7 +90,7 @@ int ff_getaddrinfo(const char *node, const char *service,
sin->sin_family = AF_INET; sin->sin_family = AF_INET;
if (node) { if (node) {
if (!inet_aton(node, &sin->sin_addr)) { if (!ff_inet_aton(node, &sin->sin_addr)) {
if (hints && (hints->ai_flags & AI_NUMERICHOST)) { if (hints && (hints->ai_flags & AI_NUMERICHOST)) {
av_free(sin); av_free(sin);
return EAI_FAIL; return EAI_FAIL;
...@@ -221,7 +226,7 @@ const char *ff_gai_strerror(int ecode) ...@@ -221,7 +226,7 @@ const char *ff_gai_strerror(int ecode)
int resolve_host(struct in_addr *sin_addr, const char *hostname) int resolve_host(struct in_addr *sin_addr, const char *hostname)
{ {
if (!inet_aton(hostname, sin_addr)) { if (!ff_inet_aton(hostname, sin_addr)) {
#if HAVE_GETADDRINFO #if HAVE_GETADDRINFO
struct addrinfo *ai, *cur; struct addrinfo *ai, *cur;
struct addrinfo hints; struct addrinfo hints;
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
/* needed by inet_aton() */
#define _SVID_SOURCE
#include "libavutil/base64.h" #include "libavutil/base64.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
...@@ -359,7 +356,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, ...@@ -359,7 +356,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
if (strcmp(buf1, "IP4") != 0) if (strcmp(buf1, "IP4") != 0)
return; return;
get_word_sep(buf1, sizeof(buf1), "/", &p); get_word_sep(buf1, sizeof(buf1), "/", &p);
if (inet_aton(buf1, &sdp_ip) == 0) if (ff_inet_aton(buf1, &sdp_ip) == 0)
return; return;
ttl = 16; ttl = 16;
if (*p == '/') { if (*p == '/') {
...@@ -803,7 +800,7 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p) ...@@ -803,7 +800,7 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
if (*p == '=') { if (*p == '=') {
p++; p++;
get_word_sep(buf, sizeof(buf), ";,", &p); get_word_sep(buf, sizeof(buf), ";,", &p);
if (inet_aton(buf, &ipaddr)) if (ff_inet_aton(buf, &ipaddr))
th->destination = ntohl(ipaddr.s_addr); th->destination = ntohl(ipaddr.s_addr);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment