Changes in sock.h [4146a07:e4d6271]
Legend:
- Unmodified
- Added
- Removed
-
sock.h
r4146a07 re4d6271 1 #include <errno.h> 2 #include <fcntl.h> 3 4 /* To cut down on the ifdef stuff a little bit in other places */ 5 #ifdef IPV6 6 #define AF_INETx AF_INET6 7 #else 8 #define AF_INETx AF_INET 9 #endif 10 1 11 #ifndef _WIN32 2 12 #include <unistd.h> … … 6 16 #include <netdb.h> 7 17 #define sock_make_nonblocking(fd) fcntl(fd, F_SETFL, O_NONBLOCK) 18 #define sock_make_blocking(fd) fcntl(fd, F_SETFL, 0) 8 19 #define sockerr_again() (errno == EINPROGRESS || errno == EINTR) 9 20 #define closesocket(a) close(a) 10 21 #else 11 22 # include <winsock2.h> 23 # ifndef _MSC_VER 24 # include <ws2tcpip.h> 25 # endif 12 26 # if !defined(BITLBEE_CORE) && defined(_MSC_VER) 13 27 # pragma comment(lib,"bitlbee.lib") … … 16 30 # define read(a,b,c) recv(a,b,c,0) 17 31 # define write(a,b,c) send(a,b,c,0) 32 # define umask _umask 33 # define mode_t int 18 34 # define sock_make_nonblocking(fd) { int non_block = 1; ioctlsocket(fd, FIONBIO, &non_block); } 35 # define sock_make_blocking(fd) { int non_block = 0; ioctlsocket(fd, FIONBIO, &non_block); } 19 36 # define sockerr_again() (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK) 20 37 # define ETIMEDOUT WSAETIMEDOUT
Note: See TracChangeset
for help on using the changeset viewer.