aboutsummaryrefslogtreecommitdiff
path: root/src/win32_compatibility.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/win32_compatibility.h')
-rw-r--r--src/win32_compatibility.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/win32_compatibility.h b/src/win32_compatibility.h
index a1b9c97..7d1f79b 100644
--- a/src/win32_compatibility.h
+++ b/src/win32_compatibility.h
@@ -9,6 +9,15 @@
9#define WIN32_COMPATIBILITY__H 9#define WIN32_COMPATIBILITY__H
10 10
11#ifdef WIN32 11#ifdef WIN32
12 #define DYNLOAD DynamicWinsock2::
13#else
14 #define DYNLOAD
15#endif
16
17#ifdef WIN32
18
19#include <Winsock2.h>
20#include "fstring.h"
12 21
13#ifndef TEMP_FAILURE_RETRY 22#ifndef TEMP_FAILURE_RETRY
14#define TEMP_FAILURE_RETRY(expression) \ 23#define TEMP_FAILURE_RETRY(expression) \
@@ -19,9 +28,31 @@
19 __result; })) 28 __result; }))
20#endif 29#endif
21 30
22//__extension__ typedef unsigned int socklen_t;
23__extension__ typedef int socklen_t; 31__extension__ typedef int socklen_t;
24 32
33namespace DynamicWinsock2
34{
35 void inet_ntoa( Bu::FString &out, struct in_addr addr_in );
36 unsigned long inet_addr( const char *s_in );
37 int select(int nfds, fd_set *readfds, fd_set *writefds,
38 fd_set *exceptfds, const struct timeval *timeout);
39 SOCKET socket(int domain, int type, int protocol);
40 int ioctlsocket(SOCKET s, long cmd, u_long *argp);
41 u_short htons(u_short in);
42 u_long htonl(u_long in);
43 struct hostent *gethostbyname(const char *name);
44 int connect(SOCKET s, const struct sockaddr *serv_addr, int addrlen);
45 int getpeername(SOCKET s, struct sockaddr *name, int *namelen);
46 int setsockopt(SOCKET s, int level, int optname,
47 const char *optval, int optlen);
48 int bind(SOCKET s, const struct sockaddr *my_addr, int addrlen);
49 int listen(SOCKET s, int backlog);
50 SOCKET accept(SOCKET s, struct sockaddr *addr, int *addrlen);
51 int recv( SOCKET s, char *buf, int len, int flags );
52 int send( SOCKET s, const char *buf, int len, int flags );
53 int DYN_FD_ISSET(SOCKET s, fd_set *set);
54};
55
25#endif /* WIN32 */ 56#endif /* WIN32 */
26#endif 57#endif
27 58