Pol  Revision:cb584c9
sockets.h
Go to the documentation of this file.
1 
7 #ifndef __SOCKETS_H
8 #define __SOCKETS_H
9 
10 #ifdef _WIN32
11 #include "../clib/Header_Windows.h"
12 #define SOCKET_ERRNO( x ) WSA##x
13 #define socket_errno WSAGetLastError()
14 typedef int socklen_t;
15 
16 #else
17 // WTF! socket isn't a type.
18 
19 typedef int SOCKET;
20 
21 #include <netinet/in.h>
22 #include <netinet/tcp.h>
23 #include <arpa/inet.h>
24 #include <sys/socket.h>
25 #include <sys/types.h>
26 #include <netdb.h>
27 #include <sys/time.h>
28 #include <unistd.h>
29 #include <fcntl.h>
30 #include <errno.h>
31 
32 #define SOCKET_ERRNO( x ) x
33 #define socket_errno errno
34 #define INVALID_SOCKET ( SOCKET )( -1 )
35 
36 #endif
37 
38 #endif
int SOCKET
Definition: sockets.h:19