It should be included via e_os.h instead.
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Sat Jun 20 11:00:42 2026
(Merged from https://github.com/openssl/openssl/pull/31587)
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <windows.h>
#include <tchar.h>
+#include "internal/e_os.h"
#include "internal/numbers.h"
#ifndef LPDIR_H
#include "LPdir.h"
#endif
#include "internal/cryptlib.h"
#ifdef _WIN32
-#include <windows.h>
+#include "internal/e_os.h"
#else
#include <unistd.h>
#endif
#ifdef ASYNC_WIN
-#include <windows.h>
+#include "internal/e_os.h"
#include "internal/cryptlib.h"
int ASYNC_is_capable(void)
#include <openssl/crypto.h>
#include <openssl/e_os2.h>
+#include <internal/e_os.h>
typedef struct async_ctx_st async_ctx;
typedef struct async_pool_st async_pool;
#define ASYNC_WIN
#define ASYNC_ARCH
-#include <windows.h>
#include "internal/cryptlib.h"
typedef struct async_fibre_st {
#include <stdlib.h>
#include <string.h>
#include <openssl/objects.h>
+#include "internal/e_os.h"
#include "internal/comp.h"
#include <openssl/err.h>
#include "crypto/cryptlib.h"
* work. Therefore, all BROTLI routines are loaded at run time
* and we do not link to a .LIB file when BROTLI_SHARED is set.
*/
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
-#endif
-
#ifdef BROTLI_SHARED
#include "internal/dso.h"
#include <stdlib.h>
#include <string.h>
#include <openssl/objects.h>
+#include "internal/e_os.h"
#include "internal/comp.h"
#include <openssl/err.h>
#include "crypto/cryptlib.h"
* work. Therefore, all ZLIB routines are loaded at run time
* and we do not link to a .LIB file when ZLIB_SHARED is set.
*/
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
-#endif /* !(OPENSSL_SYS_WINDOWS || \
- * OPENSSL_SYS_WIN32) */
#ifdef ZLIB_SHARED
#include "internal/dso.h"
#include <stdlib.h>
#include <string.h>
#include <openssl/objects.h>
+#include "internal/e_os.h"
#include "internal/comp.h"
#include <openssl/err.h>
#include "crypto/cryptlib.h"
};
#endif
-/*
- * When OpenSSL is built on Windows, we do not want to require that
- * the LIBZSTD.DLL be available in order for the OpenSSL DLLs to
- * work. Therefore, all ZSTD routines are loaded at run time
- * and we do not link to a .LIB file when ZSTD_SHARED is set.
- */
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
-#endif
-
#ifdef ZSTD_SHARED
#include "internal/dso.h"
#ifndef OPENSSL_NO_SECURE_MEMORY
#if defined(_WIN32)
-#include <windows.h>
#if defined(WINAPI_FAMILY_PARTITION)
#if !defined(WINAPI_PARTITION_SYSTEM)
#define WINAPI_PARTITION_SYSTEM 0
#include <openssl/rand.h>
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-#include <windows.h>
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
#define DEPRECATED_RAND_FUNCTIONS_DEFINED
#include <sys/stat.h>
#include <fcntl.h>
#if defined(_WIN32) && !defined(_WIN32_WCE)
-#include <windows.h>
#include <io.h>
#define stat _stat
#define chmod _chmod
#endif
#elif defined(_WIN32) && !defined(OPENSSL_SYS_UEFI)
-#include <windows.h>
static void ossl_sleep_millis(uint64_t millis)
{
* https://www.openssl.org/source/license.html
*/
-#include <internal/thread_arch.h>
+#include "internal/thread_arch.h"
+#include "internal/e_os.h"
#if defined(OPENSSL_THREADS_WINNT)
#include <process.h>
-#include <windows.h>
static unsigned __stdcall thread_start_thunk(LPVOID vthread)
{
* https://www.openssl.org/source/license.html
*/
-#if defined(_WIN32)
-#include <windows.h>
+#include "internal/e_os.h"
+
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
#define USE_RWLOCK
#endif
-#endif
-#include <assert.h>
+#include <assert.h>
#include <openssl/crypto.h>
#include <crypto/cryptlib.h>
#include "internal/common.h"
#endif
#ifdef WIN_CONSOLE_BUG
-#include <windows.h>
#ifndef OPENSSL_SYS_WINCE
#include <wincon.h>
#endif
#define OSSL_INTERNAL_THREAD_ARCH_H
#include <openssl/configuration.h>
#include <openssl/e_os2.h>
+#include "internal/e_os.h"
#include "internal/time.h"
-#if defined(_WIN32)
-#include <windows.h>
-#endif
-
#if defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_UNIX)
#define OPENSSL_THREADS_POSIX
#elif defined(OPENSSL_THREADS) && defined(OPENSSL_SYS_VMS)
* https://www.openssl.org/source/license.html
*/
+#include "internal/e_os.h" /* For windows.h */
#include "internal/cryptlib.h"
#include <openssl/rand.h>
#include "crypto/rand_pool.h"
#error "Unsupported seeding method configured; must be os"
#endif
-#include <windows.h>
/* On Windows Vista or higher use BCrypt instead of the legacy CryptoAPI */
#if defined(_MSC_VER) && _MSC_VER > 1500 /* 1500 = Visual Studio 2008 */ \
&& defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600