Mercurial > mplayer.hg
comparison stream/pnm.c @ 28402:c884d17bd005
Convert HAVE_WINSOCK2_H into a 0/1 definition.
author | diego |
---|---|
date | Sun, 01 Feb 2009 13:42:27 +0000 |
parents | ae5da477539e |
children | 0f1b5b68af32 |
comparison
equal
deleted
inserted
replaced
28401:e0d9eb28e807 | 28402:c884d17bd005 |
---|---|
33 #include <fcntl.h> | 33 #include <fcntl.h> |
34 #include <errno.h> | 34 #include <errno.h> |
35 #include <stdlib.h> | 35 #include <stdlib.h> |
36 #include <sys/time.h> | 36 #include <sys/time.h> |
37 #include <inttypes.h> | 37 #include <inttypes.h> |
38 #ifndef HAVE_WINSOCK2_H | 38 #if !HAVE_WINSOCK2_H |
39 #include <sys/socket.h> | 39 #include <sys/socket.h> |
40 //#include <netinet/in.h> | 40 //#include <netinet/in.h> |
41 //#include <netdb.h> | 41 //#include <netdb.h> |
42 #else | 42 #else |
43 #include <winsock2.h> | 43 #include <winsock2.h> |
202 n = send (s, &buf[total], len - total, 0); | 202 n = send (s, &buf[total], len - total, 0); |
203 | 203 |
204 if (n > 0) | 204 if (n > 0) |
205 total += n; | 205 total += n; |
206 else if (n < 0) { | 206 else if (n < 0) { |
207 #ifndef HAVE_WINSOCK2_H | 207 #if !HAVE_WINSOCK2_H |
208 if (timeout>0 && (errno == EAGAIN || errno == EINPROGRESS)) { | 208 if (timeout>0 && (errno == EAGAIN || errno == EINPROGRESS)) { |
209 #else | 209 #else |
210 if (timeout>0 && (errno == EAGAIN || WSAGetLastError() == WSAEINPROGRESS)) { | 210 if (timeout>0 && (errno == EAGAIN || WSAGetLastError() == WSAEINPROGRESS)) { |
211 #endif | 211 #endif |
212 usec_sleep (1000000); timeout--; | 212 usec_sleep (1000000); timeout--; |