--- parser3/src/lib/smtp/smtp.h 2006/04/09 13:38:47 1.7 +++ parser3/src/lib/smtp/smtp.h 2017/02/07 22:00:39 1.14 @@ -1,94 +1,98 @@ /** @file Parser: SMTP sender decl. - Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_SMTP_H="$Date: 2006/04/09 13:38:47 $"; +#define IDENT_SMTP_H "$Id: smtp.h,v 1.14 2017/02/07 22:00:39 moko Exp $" #include "pa_string.h" -#ifdef CYGWIN -#define _GNU_H_WINDOWS32_SOCKETS -// for PASCAL +#ifdef _MSC_VER + #include -// SOCKET -typedef u_int SOCKET; -int PASCAL closesocket(SOCKET); -#else -# if defined(WIN32) -# define WINVER 0x0400 -# include -# else - typedef char CHAR; - typedef u_int SOCKET; -# define closesocket close - inline int WSAGetLastError() { return errno; } + +#else //_MSC_VER + +typedef char CHAR; +typedef u_int SOCKET; +#define closesocket close +inline int WSAGetLastError() { return errno; } #ifdef EPROTONOSUPPORT -# define WSAEPROTONOSUPPORT EPROTONOSUPPORT +# define WSAEPROTONOSUPPORT EPROTONOSUPPORT #else -# define WSAEPROTONOSUPPORT (10000) +# define WSAEPROTONOSUPPORT (10000) #endif + #ifdef ESOCKTNOSUPPORT -# define WSAESOCKTNOSUPPORT ESOCKTNOSUPPORT +# define WSAESOCKTNOSUPPORT ESOCKTNOSUPPORT #else -# define WSAESOCKTNOSUPPORT (10001) +# define WSAESOCKTNOSUPPORT (10001) #endif + #ifdef ENOTCONN -# define WSAENOTCONN ENOTCONN +# define WSAENOTCONN ENOTCONN #else -# define WSAENOTCONN (10002) +# define WSAENOTCONN (10002) #endif + #ifdef ESHUTDOWN -# define WSAENETDOWN ESHUTDOWN +# define WSAENETDOWN ESHUTDOWN #else -# define WSAENETDOWN (10003) +# define WSAENETDOWN (10003) #endif + #ifdef EHOSTUNREACH -# define WSAENETUNREACH EHOSTUNREACH +# define WSAENETUNREACH EHOSTUNREACH #else -# define WSAENETUNREACH (10004) +# define WSAENETUNREACH (10004) #endif + #ifdef ENETRESET -# define WSAENETRESET ENETRESET +# define WSAENETRESET ENETRESET #else -# define WSAENETRESET (10005) +# define WSAENETRESET (10005) #endif + #ifdef ECONNABORTED -# define WSAECONNABORTED ECONNABORTED +# define WSAECONNABORTED ECONNABORTED #else -# define WSAECONNABORTED (10006) +# define WSAECONNABORTED (10006) #endif + #ifdef ECONNRESET -# define WSAECONNRESET ECONNRESET +# define WSAECONNRESET ECONNRESET #else -# define WSAECONNRESET (10007) +# define WSAECONNRESET (10007) #endif + #ifdef EWOULDBLOCK -# define WSAEWOULDBLOCK EWOULDBLOCK +# define WSAEWOULDBLOCK EWOULDBLOCK #else -# define WSAEWOULDBLOCK (10008) +# define WSAEWOULDBLOCK (10008) #endif + #ifdef ECONNREFUSED -# define WSAECONNREFUSED ECONNREFUSED +# define WSAECONNREFUSED ECONNREFUSED #else -# define WSAECONNREFUSED (10009) +# define WSAECONNREFUSED (10009) #endif -# define WSAHOST_NOT_FOUND (10010) -# ifndef INADDR_NONE -# define INADDR_NONE ((unsigned long) -1) -# endif +#define WSAHOST_NOT_FOUND (10010) -# ifndef INVALID_SOCKET -# define INVALID_SOCKET (SOCKET)(~0) -# endif -# endif +#ifndef INADDR_NONE +# define INADDR_NONE ((unsigned long) -1) #endif +#ifndef INVALID_SOCKET +# define INVALID_SOCKET (SOCKET)(~0) +#endif + +#endif //_MSC_VER + ////////////////////////////////////////////////////////////////////////////// #define SOCKET_BUFFER_SIZE 512