Use closesocket macro consistently, not close directly, for easier
[openssl.git] / e_os.h
diff --git a/e_os.h b/e_os.h
index bbb1c304d6556c2e0d8a66dccb2b10484607dfe0..5eaa3cca1bdfdc7f5c3b6271f8c1f7a78fd59ce2 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -59,6 +59,8 @@
 #ifndef HEADER_E_OS_H
 #define HEADER_E_OS_H
 
+#include <openssl/opensslconf.h>
+
 #include <openssl/e_os2.h>
 /* <openssl/e_os2.h> contains what we can justify to make visible
  * to the outside; this file e_os.h is not part of the exported
@@ -103,9 +105,6 @@ 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
@@ -229,7 +228,8 @@ extern "C" {
                                     return(n); } while(0)
 #    endif
 #  else
-#    include <unistd.h>
+     /* !defined VMS */
+#    include OPENSSL_UNISTD
 
 #    define OPENSSL_CONF       "openssl.cnf"
 #    define SSLEAY_CONF                OPENSSL_CONF
@@ -320,8 +320,8 @@ extern HINSTANCE _hInstance;
 
 #    define SSLeay_Read(a,b,c)     read((a),(b),(c))
 #    define SSLeay_Write(a,b,c)    write((a),(b),(c))
-#    define SHUTDOWN(fd)    { shutdown((fd),0); close((fd)); }
-#    define SHUTDOWN2(fd)   { shutdown((fd),2); close((fd)); }
+#    define SHUTDOWN(fd)    { shutdown((fd),0); closesocket((fd)); }
+#    define SHUTDOWN2(fd)   { shutdown((fd),2); closesocket((fd)); }
 #    define INVALID_SOCKET     (-1)
 #  endif
 #endif