diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-02-01 14:38:28 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-02-01 14:38:28 +0000 |
commit | 7e1662839a13794af3b0262b8cb99c0965acf072 (patch) | |
tree | 75e53dced5a313f4a446aa344365766adcc1b584 /stream | |
parent | 0d86a0f652c5a131961d580e2704b1a74478fc7b (diff) | |
download | mpv-7e1662839a13794af3b0262b8cb99c0965acf072.tar.bz2 mpv-7e1662839a13794af3b0262b8cb99c0965acf072.tar.xz |
Restructure network tests: Always check for both inet_aton and inet_pton.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28439 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r-- | stream/librtsp/rtsp_rtp.c | 20 | ||||
-rw-r--r-- | stream/tcp.c | 10 | ||||
-rw-r--r-- | stream/udp.c | 12 |
3 files changed, 17 insertions, 25 deletions
diff --git a/stream/librtsp/rtsp_rtp.c b/stream/librtsp/rtsp_rtp.c index 0d84480a6b..54a2180375 100644 --- a/stream/librtsp/rtsp_rtp.c +++ b/stream/librtsp/rtsp_rtp.c @@ -297,13 +297,11 @@ rtp_connect (char *hostname, int port) if (!hostname || !strcmp (hostname, "0.0.0.0")) sin.sin_addr.s_addr = htonl (INADDR_ANY); else -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - inet_aton (hostname, &sin.sin_addr); -#else +#if HAVE_INET_PTON inet_pton (AF_INET, hostname, &sin.sin_addr); -#endif -#else +#elif HAVE_INET_ATON + inet_aton (hostname, &sin.sin_addr); +#elif HAVE_WINSOCK2_H sin.sin_addr.s_addr = htonl (INADDR_ANY); #endif sin.sin_port = htons (port); @@ -386,13 +384,11 @@ is_multicast_address (char *addr) sin.sin_family = AF_INET; -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - inet_aton (addr, &sin.sin_addr); -#else +#if HAVE_INET_PTON inet_pton (AF_INET, addr, &sin.sin_addr); -#endif -#else +#elif HAVE_INET_ATON + inet_aton (addr, &sin.sin_addr); +#elif HAVE_WINSOCK2_H sin.sin_addr.s_addr = htonl (INADDR_ANY); #endif diff --git a/stream/tcp.c b/stream/tcp.c index 2cabc5e036..ac3165b1a7 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -115,13 +115,11 @@ connect2Server_with_af(char *host, int port, int af,int verb) { memset(&server_address, 0, sizeof(server_address)); -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - if (inet_aton(host, our_s_addr)!=1) -#else +#if HAVE_INET_PTON if (inet_pton(af, host, our_s_addr)!=1) -#endif -#else +#elif HAVE_INET_ATON + if (inet_aton(host, our_s_addr)!=1) +#elif HAVE_WINSOCK2_H if ( inet_addr(host)==INADDR_NONE ) #endif { diff --git a/stream/udp.c b/stream/udp.c index 3731859655..84769ce403 100644 --- a/stream/udp.c +++ b/stream/udp.c @@ -91,15 +91,13 @@ udp_open_socket (URL_t *url) } else { -#if !HAVE_WINSOCK2_H -#if HAVE_INET_ATON - inet_aton (url->hostname, &server_address.sin_addr); -#else +#if HAVE_INET_PTON inet_pton (AF_INET, url->hostname, &server_address.sin_addr); -#endif /* HAVE_INET_ATON */ -#else +#elif HAVE_INET_ATON + inet_aton (url->hostname, &server_address.sin_addr); +#elif !HAVE_WINSOCK2_H server_address.sin_addr.s_addr = htonl(INADDR_ANY); -#endif /* HAVE_WINSOCK2_H */ +#endif } server_address.sin_family = AF_INET; server_address.sin_port = htons (url->port); |