--- parser3/src/main/pa_socks.C 2003/01/28 12:11:50 1.18.2.1 +++ parser3/src/main/pa_socks.C 2003/07/24 11:31:24 1.19 @@ -1,20 +1,42 @@ /** @file Parser: socks initialization/finalization. - Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_SOCKS_C="$Date: 2003/01/28 12:11:50 $"; +static const char* IDENT_SOCKS_C="$Date: 2003/07/24 11:31:24 $"; #define NO_UNISTD_H #include "pa_config_includes.h" -#ifdef HAVE_WINSOCK_H +#ifdef WIN32 #include "pa_exception.h" #include "pa_socks.h" +#include "pa_string.h" -#include +// in cygwin: for pascal +// in MSVC: for everything +#include + +#ifdef CYGWIN +// WSADATA +#define WSADESCRIPTION_LEN 256 +#define WSASYS_STATUS_LEN 128 +typedef struct WSAData { + WORD wVersion; + WORD wHighVersion; + char szDescription[WSADESCRIPTION_LEN+1]; + char szSystemStatus[WSASYS_STATUS_LEN+1]; + unsigned short iMaxSockets; + unsigned short iMaxUdpDg; + char * lpVendorInfo; +} WSADATA; +typedef WSADATA *LPWSADATA; + +int PASCAL WSAStartup(WORD,LPWSADATA); +int PASCAL WSACleanup(void); +#endif WSADATA wsaData; @@ -28,7 +50,7 @@ void pa_init_socks() { /* Tell the user that we could not find a usable */ /* WinSock DLL. */ throw Exception(0, - Exception::undefined_source, + 0, "can not WSAStartup, err=%d", err); }