X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=e_os.h;h=01a9c9402a7d91d5667fba0d6c937e733a403e6e;hp=510db0e9ac5dae434cf306014e66726267970dcb;hb=21419a74131b55964efcde3421903fa2e424f6a9;hpb=dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c diff --git a/e_os.h b/e_os.h index 510db0e9ac..01a9c9402a 100644 --- a/e_os.h +++ b/e_os.h @@ -75,10 +75,6 @@ extern "C" { #define DEVRANDOM "/dev/urandom" #endif -#if defined(NOCONST) -#define const -#endif - /******************************************************************** The Microsoft section ********************************************************************/ @@ -102,6 +98,12 @@ extern "C" { #ifdef WIN32 #define get_last_sys_error() GetLastError() #define clear_sys_error() SetLastError(0) +/* These are defined in wincrypt.h and can cause problems */ +#undef X509_NAME +#undef PKCS7_SIGNER_INFO +#if !defined(WINNT) +#define WIN_CONSOLE_BUG +#endif #else #define get_last_sys_error() errno #define clear_sys_error() errno=0 @@ -143,9 +145,13 @@ extern "C" { #ifndef S_IFMT #define S_IFMT _S_IFMT + +#if !defined(WINNT) +#define NO_SYSLOG #endif +#define NO_DIRENT -#define strncasecmp(a,b,c) strnicmp((a),(b),(c)) +#endif # ifdef WINDOWS # include @@ -157,6 +163,13 @@ extern "C" { # include # include +#if defined (__BORLANDC__) +#define _setmode setmode +#define _O_TEXT O_TEXT +#define _O_BINARY O_BINARY +#define _int64 __int64 +#endif + #if defined(WIN16) && !defined(MONOLITH) && defined(SSLEAY) && defined(_WINEXITNOPERSIST) # define EXIT(n) { if (n == 0) _wsetexit(_WINEXITNOPERSIST); return(n); } #else @@ -172,32 +185,75 @@ extern "C" { #ifndef R_OK # define R_OK 4 #endif -# define SSLEAY_CONF "ssleay.cnf" +# define OPENSSL_CONF "openssl.cnf" +# define SSLEAY_CONF OPENSSL_CONF # define NUL_DEV "nul" # define RFILE ".rnd" #else /* The non-microsoft world world */ +# if defined(__VMS) && !defined(VMS) +# define VMS 1 +# endif + # ifdef VMS -# include + /* some programs don't include stdlib, so exit() and others give implicit + function warnings */ +# include +# if defined(__DECC) +# include +# else +# include +# endif +# define OPENSSL_CONF "openssl.cnf" +# define SSLEAY_CONF OPENSSL_CONF +# define RFILE ".rnd" +# define LIST_SEPARATOR_CHAR ',' +# define NUL_DEV "NLA0:" + /* We need to do this, because DEC C converts exit code 0 to 1, but not 1 + to 0. We will convert 1 to 3! Also, add the inhibit message bit... */ +# ifndef MONOLITH +# define EXIT(n) do { int __VMS_EXIT = n; \ + if (__VMS_EXIT == 1) __VMS_EXIT = 3; \ + __VMS_EXIT |= 0x10000000; \ + exit(n); return(n); } while(0) +# else +# define EXIT(n) do { int __VMS_EXIT = n; \ + if (__VMS_EXIT == 1) __VMS_EXIT = 3; \ + __VMS_EXIT |= 0x10000000; \ + return(n); } while(0) +# endif # else # include -# endif -# define SSLEAY_CONF "ssleay.cnf" -# define RFILE ".rnd" -# define LIST_SEPARATOR_CHAR ':' -# ifndef MONOLITH -# define EXIT(n) exit(n); return(n) -# else -# define EXIT(n) return(n) +# define OPENSSL_CONF "openssl.cnf" +# define SSLEAY_CONF OPENSSL_CONF +# define RFILE ".rnd" +# define LIST_SEPARATOR_CHAR ':' +# define NUL_DEV "/dev/null" +# ifndef MONOLITH +# define EXIT(n) exit(n); return(n) +# else +# define EXIT(n) return(n) +# endif # endif -# define NUL_DEV "/dev/null" # define SSLeay_getpid() getpid() #endif +/* Definitions of GLOBAL and EXTERN, to define and declare certain global + symbols that, with some compilers under VMS, have to be defined and + declared explicitely with globaldef and globalref. On other OS:es, + these macros are defined with something sensible. */ +#if defined(VMS) && !defined(__DECC) +#define EXTERN globalref +#define GLOBAL globaldef +#else +#define EXTERN extern +#define GLOBAL +#endif + /*************/ #ifdef USE_SOCKETS @@ -221,16 +277,21 @@ extern HINSTANCE _hInstance; # else +# include # ifndef VMS - /* unix world */ -# include -# include +# include +# endif +# include /* Needed under linux for FD_XXX */ + +# include +# if defined(VMS) && !defined(__DECC) +# include +# include +# else # include # ifdef FILIO_H # include /* Added for FIONBIO under unixware */ # endif -# include -# include /* Needed under linux for FD_XXX */ # include # endif @@ -246,11 +307,21 @@ extern HINSTANCE _hInstance; # if defined(sun) # include # else -# include +# ifndef VMS +# include +# else + /* ioctl is only in VMS > 7.0 and when socketshr is not used */ +# if !defined(TCPIP_TYPE_SOCKETSHR) && defined(__VMS_VER) && (__VMS_VER > 70000000) +# include +# endif +# endif # endif # ifdef VMS # include +# if defined(TCPIP_TYPE_SOCKETSHR) +# include +# endif # endif # define SSLeay_Read(a,b,c) read((a),(b),(c)) @@ -269,26 +340,6 @@ extern HINSTANCE _hInstance; /***********************************************/ -#ifndef NOPROTO -#define P_CC_CC const void *,const void * -#define P_I_I int,int -#define P_I_I_P int,int,char * -#define P_I_I_P_I int,int,char *,int -#define P_IP_I_I_P_I int *,int,int,char *,int -#define P_V void -#else -#define P_CC_CC -#define P_I_I -#define P_I_I_P -#define P_IP_I_I_P_I -#define P_I_I_P_I -#define P_V -#endif - -/* not used yet */ -#define CS_BEGIN -#define CS_END - /* do we need to do this for getenv. * Just define getenv for use under windows */