# HG changeset patch # User diego # Date 1233495747 0 # Node ID c884d17bd0055b727701b7f6a0f004368d955fd8 # Parent e0d9eb28e80797f3fb2269e0a6c2465e0227e038 Convert HAVE_WINSOCK2_H into a 0/1 definition. diff -r e0d9eb28e807 -r c884d17bd005 configure --- a/configure Sun Feb 01 13:40:15 2009 +0000 +++ b/configure Sun Feb 01 13:42:27 2009 +0000 @@ -2911,7 +2911,7 @@ _ld_sock="-lws2_32" def_winsock2_h='#define HAVE_WINSOCK2_H 1' else - def_winsock2_h='#undef HAVE_WINSOCK2_H' + def_winsock2_h='#define HAVE_WINSOCK2_H 0' fi diff -r e0d9eb28e807 -r c884d17bd005 stream/asf_mmst_streaming.c --- a/stream/asf_mmst_streaming.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/asf_mmst_streaming.c Sun Feb 01 13:42:27 2009 +0000 @@ -39,7 +39,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif diff -r e0d9eb28e807 -r c884d17bd005 stream/asf_streaming.c --- a/stream/asf_streaming.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/asf_streaming.c Sun Feb 01 13:42:27 2009 +0000 @@ -9,7 +9,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif diff -r e0d9eb28e807 -r c884d17bd005 stream/http.c --- a/stream/http.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/http.c Sun Feb 01 13:42:27 2009 +0000 @@ -11,7 +11,7 @@ #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #else #include #include diff -r e0d9eb28e807 -r c884d17bd005 stream/librtsp/rtsp.c --- a/stream/librtsp/rtsp.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/librtsp/rtsp.c Sun Feb 01 13:42:27 2009 +0000 @@ -42,7 +42,7 @@ #include #include #include -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #else #include @@ -72,7 +72,7 @@ if (n > 0) total += n; else if (n < 0) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if ((timeout>0) && ((errno == EAGAIN) || (errno == EINPROGRESS))) { #else if ((timeout>0) && ((errno == EAGAIN) || (WSAGetLastError() == WSAEINPROGRESS))) { diff -r e0d9eb28e807 -r c884d17bd005 stream/librtsp/rtsp_rtp.c --- a/stream/librtsp/rtsp_rtp.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/librtsp/rtsp_rtp.c Sun Feb 01 13:42:27 2009 +0000 @@ -28,7 +28,7 @@ #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -251,7 +251,7 @@ if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (errno != EINPROGRESS) #else if (WSAGetLastError() != WSAEINPROGRESS) @@ -297,7 +297,7 @@ if (!hostname || !strcmp (hostname, "0.0.0.0")) sin.sin_addr.s_addr = htonl (INADDR_ANY); else -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #if HAVE_INET_ATON inet_aton (hostname, &sin.sin_addr); #else @@ -332,7 +332,7 @@ /* datagram socket */ if (bind (s, (struct sockaddr *) &sin, sizeof (sin))) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (errno != EINPROGRESS) #else if (WSAGetLastError() != WSAEINPROGRESS) @@ -386,7 +386,7 @@ sin.sin_family = AF_INET; -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #if HAVE_INET_ATON inet_aton (addr, &sin.sin_addr); #else diff -r e0d9eb28e807 -r c884d17bd005 stream/librtsp/rtsp_session.c --- a/stream/librtsp/rtsp_session.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/librtsp/rtsp_session.c Sun Feb 01 13:42:27 2009 +0000 @@ -30,7 +30,7 @@ #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff -r e0d9eb28e807 -r c884d17bd005 stream/network.c --- a/stream/network.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/network.c Sun Feb 01 13:42:27 2009 +0000 @@ -19,7 +19,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #include #endif diff -r e0d9eb28e807 -r c884d17bd005 stream/network.h --- a/stream/network.h Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/network.h Sun Feb 01 13:42:27 2009 +0000 @@ -12,7 +12,7 @@ #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff -r e0d9eb28e807 -r c884d17bd005 stream/pnm.c --- a/stream/pnm.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/pnm.c Sun Feb 01 13:42:27 2009 +0000 @@ -35,7 +35,7 @@ #include #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include //#include //#include @@ -204,7 +204,7 @@ if (n > 0) total += n; else if (n < 0) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (timeout>0 && (errno == EAGAIN || errno == EINPROGRESS)) { #else if (timeout>0 && (errno == EAGAIN || WSAGetLastError() == WSAEINPROGRESS)) { diff -r e0d9eb28e807 -r c884d17bd005 stream/realrtsp/rmff.h --- a/stream/realrtsp/rmff.h Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/realrtsp/rmff.h Sun Feb 01 13:42:27 2009 +0000 @@ -31,7 +31,7 @@ #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff -r e0d9eb28e807 -r c884d17bd005 stream/rtp.c --- a/stream/rtp.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/rtp.c Sun Feb 01 13:42:27 2009 +0000 @@ -13,7 +13,7 @@ #include #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff -r e0d9eb28e807 -r c884d17bd005 stream/stream.c --- a/stream/stream.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/stream.c Sun Feb 01 13:42:27 2009 +0000 @@ -14,7 +14,7 @@ #include "config.h" -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif @@ -408,7 +408,7 @@ if(s==NULL) return NULL; memset(s,0,sizeof(stream_t)); -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H { WSADATA wsdata; int temp = WSAStartup(0x0202, &wsdata); // there might be a better place for this (-> later) @@ -443,7 +443,7 @@ closesocket(s->fd); else close(s->fd); } -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H mp_msg(MSGT_STREAM,MSGL_V,"WINSOCK2 uninit\n"); WSACleanup(); // there might be a better place for this (-> later) #endif diff -r e0d9eb28e807 -r c884d17bd005 stream/stream_cddb.c --- a/stream/stream_cddb.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/stream_cddb.c Sun Feb 01 13:42:27 2009 +0000 @@ -27,7 +27,7 @@ #define mkdir(a,b) mkdir(a) #endif #include -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H #include #endif #else diff -r e0d9eb28e807 -r c884d17bd005 stream/stream_ftp.c --- a/stream/stream_ftp.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/stream_ftp.c Sun Feb 01 13:42:27 2009 +0000 @@ -9,7 +9,7 @@ #include #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #else #include diff -r e0d9eb28e807 -r c884d17bd005 stream/stream_netstream.c --- a/stream/stream_netstream.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/stream_netstream.c Sun Feb 01 13:42:27 2009 +0000 @@ -42,7 +42,7 @@ #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -90,7 +90,7 @@ //// When the cache is running we need a lock as //// fill_buffer is called from another proccess static int lock_fd(int fd) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H struct flock lock; memset(&lock,0,sizeof(struct flock)); @@ -113,7 +113,7 @@ } static int unlock_fd(int fd) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H struct flock lock; memset(&lock,0,sizeof(struct flock)); diff -r e0d9eb28e807 -r c884d17bd005 stream/stream_netstream.h --- a/stream/stream_netstream.h Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/stream_netstream.h Sun Feb 01 13:42:27 2009 +0000 @@ -14,7 +14,7 @@ #include #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #endif #include "mp_msg.h" diff -r e0d9eb28e807 -r c884d17bd005 stream/stream_rtsp.c --- a/stream/stream_rtsp.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/stream_rtsp.c Sun Feb 01 13:42:27 2009 +0000 @@ -28,7 +28,7 @@ #include #include #include "config.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include diff -r e0d9eb28e807 -r c884d17bd005 stream/tcp.c --- a/stream/tcp.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/tcp.c Sun Feb 01 13:42:27 2009 +0000 @@ -20,7 +20,7 @@ #include "mp_msg.h" #include "help_mp.h" -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -75,7 +75,7 @@ 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 @@ } #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 @@ 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 @@ 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 @@ 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 @@ 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; diff -r e0d9eb28e807 -r c884d17bd005 stream/udp.c --- a/stream/udp.c Sun Feb 01 13:40:15 2009 +0000 +++ b/stream/udp.c Sun Feb 01 13:42:27 2009 +0000 @@ -31,7 +31,7 @@ #include #include -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #include #include #include @@ -74,7 +74,7 @@ if (isalpha (url->hostname[0])) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H hp = (struct hostent *) gethostbyname (url->hostname); if (!hp) { @@ -91,7 +91,7 @@ } else { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H #if HAVE_INET_ATON inet_aton (url->hostname, &server_address.sin_addr); #else @@ -110,7 +110,7 @@ if (bind (socket_server_fd, (struct sockaddr *) &server_address, sizeof (server_address)) == -1) { -#ifndef HAVE_WINSOCK2_H +#if !HAVE_WINSOCK2_H if (errno != EINPROGRESS) #else if (WSAGetLastError () != WSAEINPROGRESS) @@ -122,7 +122,7 @@ } } -#ifdef HAVE_WINSOCK2_H +#if HAVE_WINSOCK2_H if (isalpha (url->hostname[0])) { hp = (struct hostent *) gethostbyname (url->hostname);