summaryrefslogtreecommitdiffstats
path: root/stream/tcp.c
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-01 13:42:27 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-01 13:42:27 +0000
commit0f65d3be9d874251c106d8bab3c43b0439ed5526 (patch)
treefefdee42e83c5ff220f649c12dcaabff22301fff /stream/tcp.c
parent12b79487739ffedd9a74940feebe9d4ef11079dc (diff)
downloadmpv-0f65d3be9d874251c106d8bab3c43b0439ed5526.tar.bz2
mpv-0f65d3be9d874251c106d8bab3c43b0439ed5526.tar.xz
Convert HAVE_WINSOCK2_H into a 0/1 definition.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28437 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/tcp.c')
-rw-r--r--stream/tcp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/stream/tcp.c b/stream/tcp.c
index a47280739a..2cabc5e036 100644
--- a/stream/tcp.c
+++ b/stream/tcp.c
@@ -20,7 +20,7 @@
#include "mp_msg.h"
#include "help_mp.h"
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
@@ -75,7 +75,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
struct hostent *hp=NULL;
char buf[255];
-#ifdef HAVE_WINSOCK2_H
+#if HAVE_WINSOCK2_H
unsigned long val;
int to;
#else
@@ -91,7 +91,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
}
#if defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO)
-#ifdef HAVE_WINSOCK2_H
+#if HAVE_WINSOCK2_H
/* timeout in milliseconds */
to = 10 * 1000;
#else
@@ -115,7 +115,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
memset(&server_address, 0, sizeof(server_address));
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
#if HAVE_INET_ATON
if (inet_aton(host, our_s_addr)!=1)
#else
@@ -139,7 +139,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
memcpy( our_s_addr, (void*)hp->h_addr_list[0], hp->h_length );
}
-#ifdef HAVE_WINSOCK2_H
+#if HAVE_WINSOCK2_H
else {
unsigned long addr = inet_addr(host);
memcpy( our_s_addr, (void*)&addr, sizeof(addr) );
@@ -172,14 +172,14 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ConnectingToServer, host, buf , port );
// Turn the socket as non blocking so we can timeout on the connection
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
fcntl( socket_server_fd, F_SETFL, fcntl(socket_server_fd, F_GETFL) | O_NONBLOCK );
#else
val = 1;
ioctlsocket( socket_server_fd, FIONBIO, &val );
#endif
if( connect( socket_server_fd, (struct sockaddr*)&server_address, server_address_size )==-1 ) {
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
if( errno!=EINPROGRESS ) {
#else
if( (WSAGetLastError() != WSAEINPROGRESS) && (WSAGetLastError() != WSAEWOULDBLOCK) ) {
@@ -211,7 +211,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
if (ret < 0) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_SelectFailed);
// Turn back the socket as blocking
-#ifndef HAVE_WINSOCK2_H
+#if !HAVE_WINSOCK2_H
fcntl( socket_server_fd, F_SETFL, fcntl(socket_server_fd, F_GETFL) & ~O_NONBLOCK );
#else
val = 0;