Fix compiler error when using config option 'enable-acvp-tests'
[openssl.git] / e_os.h
diff --git a/e_os.h b/e_os.h
index 979be9b2b1f637cc3da68db3354c5fe6e2682423..8bfc1dcb100aa32745c23c4afb41121ee62f5138 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
         */
 #    include <winsock2.h>
 #    include <ws2tcpip.h>
+       /*
+        * Clang-based C++Builder 10.3.3 toolchains cannot find C inline
+        * definitions at link-time.  This header defines WspiapiLoad() as an
+        * __inline function.  https://quality.embarcadero.com/browse/RSP-33806
+        */
+#    if !defined(__BORLANDC__) || !defined(__clang__)
+#     include <wspiapi.h>
+#    endif
        /* yes, they have to be #included prior to <windows.h> */
 #   endif
 #   include <windows.h>
@@ -297,7 +305,7 @@ struct servent *getservbyname(const char *name, const char *proto);
 
 /* ----------------------------- HP NonStop -------------------------------- */
 /* Required to support platform variant without getpid() and pid_t. */
-# ifdef __TANDEM
+# if defined(__TANDEM) && defined(_GUARDIAN_TARGET)
 #  include <strings.h>
 #  include <netdb.h>
 #  define getservbyname(name,proto)          getservbyname((char*)name,proto)
@@ -359,10 +367,11 @@ inline int nssgetpid();
 
 # ifndef OPENSSL_NO_SECURE_MEMORY
    /* unistd.h defines _POSIX_VERSION */
-#  if defined(OPENSSL_SYS_UNIX) \
-      && ( (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L)      \
-           || defined(__sun) || defined(__hpux) || defined(__sgi)      \
-           || defined(__osf__) )
+#  if (defined(OPENSSL_SYS_UNIX) \
+        && ( (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L)      \
+             || defined(__sun) || defined(__hpux) || defined(__sgi)      \
+             || defined(__osf__) )) \
+      || defined(_WIN32)
       /* secure memory is implemented */
 #   else
 #     define OPENSSL_NO_SECURE_MEMORY