X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=libs%2Fwatt32%2Fwinsock.h;fp=libs%2Fwatt32%2Fwinsock.h;h=24f501b4a6031829775e437fd6087aa91fbde80c;hb=214a070238552de6167bbf506cbc23006969a182;hp=0000000000000000000000000000000000000000;hpb=d3c8a942b99443abf0c11d9759994022ed6da597;p=oftp diff --git a/libs/watt32/winsock.h b/libs/watt32/winsock.h new file mode 100644 index 0000000..24f501b --- /dev/null +++ b/libs/watt32/winsock.h @@ -0,0 +1,56 @@ +#ifndef _WATT32_FAKE_WINSOCK_H +#define _WATT32_FAKE_WINSOCK_H + +#ifndef __SYS_W32API_H +#include +#endif + +#ifndef __SYS_SOCKET_H +#include +#endif + +#ifndef __SYS_WERRNO_H +#include +#endif + +#if !defined(WIN32) && !defined(_WIN32) +#error This file is only for Watt-32 targeting Windows programs. +#endif + +#if !defined(_WATT32_FAKE_WINSOCK2_H) + +#define WSADESCRIPTION_LEN 256 +#define WSASYS_STATUS_LEN 128 + +typedef struct WSAData { + unsigned short wVersion; + unsigned short wHighVersion; + char szDescription[WSADESCRIPTION_LEN+1]; + char szSystemStatus[WSASYS_STATUS_LEN+1]; + unsigned short iMaxSockets; + unsigned short iMaxUdpDg; + char *lpVendorInfo; + } WSADATA, *LPWSADATA; + +W32_FUNC int __stdcall WSAStartup (unsigned short wVersionRequired, + WSADATA *WSAData); + + +#ifndef FD_SETSIZE +#define FD_SETSIZE 64 +#endif + +/* + * Needed if user compiled with the normal and just relinked + * with Watt-32 (import) library. + */ +typedef struct winsock_fd_set { + unsigned int fd_count; /* how many are SET? */ + int fd_array [FD_SETSIZE]; /* an array of sockets */ + } winsock_fd_set; + +W32_FUNC int __stdcall __WSAFDIsSet (int s, winsock_fd_set *fd); + +#endif /* _WATT32_FAKE_WINSOCK2_H */ +#endif +