summaryrefslogtreecommitdiffstats
path: root/stream/udp.c
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-01 14:38:28 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-01 14:38:28 +0000
commit7e1662839a13794af3b0262b8cb99c0965acf072 (patch)
tree75e53dced5a313f4a446aa344365766adcc1b584 /stream/udp.c
parent0d86a0f652c5a131961d580e2704b1a74478fc7b (diff)
downloadmpv-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/udp.c')
-rw-r--r--stream/udp.c12
1 files changed, 5 insertions, 7 deletions
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);