Clarify wording of verify_callback() behaviour.
[openssl.git] / e_os.h
diff --git a/e_os.h b/e_os.h
index 9992c8521830070d6a0f8c4781bb6c895cf4f3a4..3800bfd75fbd2d357d9915fd9d4f2749558935cc 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -184,7 +184,6 @@ extern "C" {
 #endif
 
 #ifdef WIN16
-#  define OPENSSL_NO_FP_API
 #  define MS_CALLBACK  _far _loadds
 #  define MS_FAR       _far
 #else
@@ -193,6 +192,7 @@ extern "C" {
 #endif
 
 #ifdef OPENSSL_NO_STDIO
+#  undef OPENSSL_NO_FP_API
 #  define OPENSSL_NO_FP_API
 #endif
 
@@ -201,6 +201,9 @@ extern "C" {
 #  ifdef __DJGPP__
 #    include <unistd.h>
 #    include <sys/stat.h>
+#    include <sys/socket.h>
+#    include <tcp.h>
+#    include <netdb.h>
 #    define _setmode setmode
 #    define _O_TEXT O_TEXT
 #    define _O_BINARY O_BINARY
@@ -230,9 +233,6 @@ extern "C" {
 #  include <fcntl.h>
 
 #  ifdef OPENSSL_SYS_WINCE
-#    include <stdio_extras.h>
-#    include <stdlib_extras.h>
-#    include <string_extras.h>
 #    include <winsock_extras.h>
 #  endif
 
@@ -246,10 +246,11 @@ extern "C" {
 #    define _kbhit kbhit
 #  endif
 
-#  if defined(WIN16) && !defined(MONOLITH) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
-#    define EXIT(n) { if (n == 0) _wsetexit(_WINEXITNOPERSIST); return(n); }
+#  if defined(WIN16) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
+#    define EXIT(n) _wsetexit(_WINEXITNOPERSIST)
+#    define OPENSSL_EXIT(n) do { if (n == 0) EXIT(n); return(n); } while(0)
 #  else
-#    define EXIT(n)            return(n);
+#    define EXIT(n) exit(n)
 #  endif
 #  define LIST_SEPARATOR_CHAR ';'
 #  ifndef X_OK
@@ -305,18 +306,13 @@ extern "C" {
      the status is tagged as an error, which I believe is what is wanted here.
      -- Richard Levitte
   */
-#    if !defined(MONOLITH) || defined(OPENSSL_C)
-#      define EXIT(n)          do { int __VMS_EXIT = n; \
+#    define EXIT(n)            do { int __VMS_EXIT = n; \
                                      if (__VMS_EXIT == 0) \
                                       __VMS_EXIT = 1; \
                                     else \
                                       __VMS_EXIT = (n << 3) | 2; \
                                      __VMS_EXIT |= 0x10000000; \
-                                    exit(__VMS_EXIT); \
-                                    return(__VMS_EXIT); } while(0)
-#    else
-#      define EXIT(n)          return(n)
-#    endif
+                                    exit(__VMS_EXIT); } while(0)
 #    define NO_SYS_PARAM_H
 #  else
      /* !defined VMS */
@@ -335,6 +331,8 @@ extern "C" {
 #      define pid_t int /* pid_t is missing on NEXTSTEP/OPENSTEP
                          * (unless when compiling with -D_POSIX_SOURCE,
                          * which doesn't work for us) */
+#    endif
+#    if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS)
 #      define ssize_t int /* ditto */
 #    endif
 #    ifdef OPENSSL_SYS_NEWS4 /* setvbuf is missing on mips-sony-bsd */
@@ -347,11 +345,7 @@ extern "C" {
 #    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
+#    define EXIT(n)            exit(n)
 #  endif
 
 #  define SSLeay_getpid()      getpid()
@@ -478,6 +472,14 @@ extern char *sys_errlist[]; extern int sys_nerr;
        (((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum])
 #endif
 
+#ifndef OPENSSL_EXIT
+# if defined(MONOLITH) && !defined(OPENSSL_C)
+#  define OPENSSL_EXIT(n) return(n)
+# else
+#  define OPENSSL_EXIT(n) do { EXIT(n); return(n); } while(0)
+# endif
+#endif
+
 /***********************************************/
 
 /* do we need to do this for getenv.