X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=e_os.h;h=6f5edfba2a9dc763f16ab141092bf392bd6dda85;hb=b317819b2e74f1f84925695596aa3c7487a2264d;hp=9a260a4141efaca097e82dbcf26aae1fcbaeeaa2;hpb=a90081576c94f9f54de1755188a00ccc1760549a;p=openssl.git diff --git a/e_os.h b/e_os.h index 9a260a4141..6f5edfba2a 100644 --- a/e_os.h +++ b/e_os.h @@ -94,20 +94,6 @@ extern "C" { # define NO_SYSLOG #endif -#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) -# if macintosh==1 -# ifndef MAC_OS_GUSI_SOURCE -# define MAC_OS_pre_X -# define NO_SYS_TYPES_H -# endif -# define NO_SYS_PARAM_H -# define NO_CHMOD -# define NO_SYSLOG -# undef DEVRANDOM -# define GETPID_IS_MEANINGLESS -# endif -#endif - /******************************************************************** The Microsoft section ********************************************************************/ @@ -150,12 +136,13 @@ extern "C" { #define clear_socket_error() WSASetLastError(0) #define readsocket(s,b,n) recv((s),(b),(n),0) #define writesocket(s,b,n) send((s),(b),(n),0) -#elif defined(MAC_OS_pre_X) +#elif defined(__DJGPP__) +#define WATT32 #define get_last_socket_error() errno #define clear_socket_error() errno=0 -#define closesocket(s) MacSocket_close(s) -#define readsocket(s,b,n) MacSocket_recv((s),(b),(n),true) -#define writesocket(s,b,n) MacSocket_send((s),(b),(n)) +#define closesocket(s) close_s(s) +#define readsocket(s,b,n) read_s(s,b,n) +#define writesocket(s,b,n) send(s,b,n,0) #elif defined(OPENSSL_SYS_VMS) #define get_last_socket_error() errno #define clear_socket_error() errno=0 @@ -170,13 +157,6 @@ extern "C" { #define closesocket(s) close(s) #define readsocket(s,b,n) read((s),(b),(n)) #define writesocket(s,b,n) write((s),(char *)(b),(n)) -#elif defined(OPENSSL_SYS_BEOS_R5) -#define get_last_socket_error() errno -#define clear_socket_error() errno=0 -#define FIONBIO SO_NONBLOCK -#define ioctlsocket(a,b,c) setsockopt((a),SOL_SOCKET,(b),(c),sizeof(*(c))) -#define readsocket(s,b,n) recv((s),(b),(n),0) -#define writesocket(s,b,n) send((s),(b),(n),0) #elif defined(OPENSSL_SYS_NETWARE) #if defined(NETWARE_BSDSOCK) #define get_last_socket_error() errno @@ -220,6 +200,19 @@ extern "C" { #if (defined(WINDOWS) || defined(MSDOS)) +# ifdef __DJGPP__ +# include +# include +# include +# include +# include +# define _setmode setmode +# define _O_TEXT O_TEXT +# define _O_BINARY O_BINARY +# undef DEVRANDOM +# define DEVRANDOM "/dev/urandom\x24" +# endif /* __DJGPP__ */ + # ifndef S_IFDIR # define S_IFDIR _S_IFDIR # endif @@ -228,7 +221,7 @@ extern "C" { # define S_IFMT _S_IFMT # endif -# if !defined(WINNT) +# if !defined(WINNT) && !defined(__DJGPP__) # define NO_SYSLOG # endif # define NO_DIRENT @@ -274,7 +267,7 @@ extern "C" { # ifdef _WIN64 # define strlen(s) _strlen31(s) /* cut strings to 2GB */ -static unsigned int _strlen31(const char *str) +static __inline unsigned int _strlen31(const char *str) { unsigned int len=0; while (*str && len<0x80000000U) str++, len++; @@ -316,10 +309,8 @@ static unsigned int _strlen31(const char *str) # endif # endif # endif -# if !defined(OPENSSL_FIPSCANISTER) # include # include -# endif # ifdef OPENSSL_SYS_WINCE # define OPENSSL_NO_POSIX_IO @@ -359,7 +350,7 @@ static unsigned int _strlen31(const char *str) # define check_winnt() (1) #else # define check_winnt() (GetVersion() < 0x80000000) -#endif +#endif #else /* The non-microsoft world */ @@ -470,6 +461,10 @@ static unsigned int _strlen31(const char *str) /*************/ +#if defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_DGRAM) +# define OPENSSL_NO_DGRAM +#endif + #ifdef USE_SOCKETS # if defined(WINDOWS) || defined(MSDOS) /* windows world */ @@ -479,7 +474,7 @@ static unsigned int _strlen31(const char *str) # define SSLeay_Read(a,b,c) (-1) # define SHUTDOWN(fd) close(fd) # define SHUTDOWN2(fd) close(fd) -# else +# elif !defined(__DJGPP__) # if defined(_WIN32_WCE) && _WIN32_WCE<410 # define getservbyname _masked_declaration_getservbyname # endif @@ -506,16 +501,13 @@ static unsigned int _strlen31(const char *str) # define SSLeay_Read(a,b,c) recv((a),(b),(c),0) # define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); } # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); } +# else +# define SSLeay_Write(a,b,c) write_s(a,b,c,0) +# define SSLeay_Read(a,b,c) read_s(a,b,c) +# define SHUTDOWN(fd) close_s(fd) +# define SHUTDOWN2(fd) close_s(fd) # endif -# elif defined(MAC_OS_pre_X) - -# include "MacSocket.h" -# define SSLeay_Write(a,b,c) MacSocket_send((a),(b),(c)) -# define SSLeay_Read(a,b,c) MacSocket_recv((a),(b),(c),true) -# define SHUTDOWN(fd) MacSocket_close(fd) -# define SHUTDOWN2(fd) MacSocket_close(fd) - # elif defined(OPENSSL_SYS_NETWARE) /* NetWare uses the WinSock2 interfaces by default, but can be configured for BSD */ @@ -569,10 +561,8 @@ static unsigned int _strlen31(const char *str) # include /* Added for FIONBIO under unixware */ # endif # include -# if !defined(OPENSSL_SYS_BEOS_R5) # include # endif -# endif # if defined(NeXT) || defined(_NEXT_SOURCE) # include @@ -620,7 +610,7 @@ static unsigned int _strlen31(const char *str) * versions. */ # if !defined(OPENSSL_USE_IPV6) -# if defined(AF_INET6) && !defined(OPENSSL_SYS_BEOS_BONE) && !defined(NETWARE_CLIB) +# if defined(AF_INET6) && !defined(NETWARE_CLIB) # define OPENSSL_USE_IPV6 1 # else # define OPENSSL_USE_IPV6 0 @@ -715,18 +705,25 @@ struct servent *getservbyname(const char *name, const char *proto); #endif /* end vxworks */ -/* beos */ -#if defined(OPENSSL_SYS_BEOS_R5) -#define SO_ERROR 0 -#define NO_SYS_UN -#define IPPROTO_IP 0 -#include +#if !defined(inline) && !defined(__cplusplus) +# if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L + /* do nothing, inline works */ +# elif defined(__GNUC__) && __GNUC__>=2 +# define inline __inline__ +# elif defined(_MSC_VER) + /* + * Visual Studio: inline is available in C++ only, however + * __inline is available for C, see + * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx + */ +# define inline __inline +# else +# define inline +# endif #endif - #ifdef __cplusplus } #endif #endif -