Changes in sock.h [e4d6271:4146a07]
Legend:
- Unmodified
- Added
- Removed
-
sock.h
re4d6271 r4146a07 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 IPV66 #define AF_INETx AF_INET67 #else8 #define AF_INETx AF_INET9 #endif10 11 1 #ifndef _WIN32 12 2 #include <unistd.h> … … 16 6 #include <netdb.h> 17 7 #define sock_make_nonblocking(fd) fcntl(fd, F_SETFL, O_NONBLOCK) 18 #define sock_make_blocking(fd) fcntl(fd, F_SETFL, 0)19 8 #define sockerr_again() (errno == EINPROGRESS || errno == EINTR) 20 9 #define closesocket(a) close(a) 21 10 #else 22 11 # include <winsock2.h> 23 # ifndef _MSC_VER24 # include <ws2tcpip.h>25 # endif26 12 # if !defined(BITLBEE_CORE) && defined(_MSC_VER) 27 13 # pragma comment(lib,"bitlbee.lib") … … 30 16 # define read(a,b,c) recv(a,b,c,0) 31 17 # define write(a,b,c) send(a,b,c,0) 32 # define umask _umask33 # define mode_t int34 18 # 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); }36 19 # define sockerr_again() (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK) 37 20 # define ETIMEDOUT WSAETIMEDOUT
Note: See TracChangeset
for help on using the changeset viewer.