Skip to content

Commit

Permalink
8285730: unify _WIN32_WINNT settings
Browse files Browse the repository at this point in the history
Backport-of: 4fd79a6ad2683e4863bd4e311cb01cbc30ebf57f
  • Loading branch information
MBaesken committed Aug 17, 2022
1 parent cb294d9 commit e650bdc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 31 deletions.
6 changes: 4 additions & 2 deletions make/autoconf/flags-cflags.m4
Expand Up @@ -470,9 +470,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
ALWAYS_DEFINES_JVM="-D_REENTRANT"
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
# Access APIs for Windows 8 and above
# see https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602 -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN"
ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602"
fi
###############################################################################
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os/windows/os_windows.cpp
Expand Up @@ -22,8 +22,7 @@
*
*/

// Must be at least Windows Vista or Server 2008 to use InitOnceExecuteOnce
#define _WIN32_WINNT 0x0600
// API level must be at least Windows Vista or Server 2008 to use InitOnceExecuteOnce

// no precompiled headers
#include "jvm.h"
Expand Down
7 changes: 1 addition & 6 deletions src/java.base/windows/native/libjava/WinCAPISeedGenerator.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,11 +23,6 @@
* questions.
*/

/* Need to define this to get CAPI functions included */
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif

#include <windows.h>
#include <wincrypt.h>
#include <jni.h>
Expand Down
5 changes: 0 additions & 5 deletions src/java.base/windows/native/libjava/WinNTFileSystem_md.c
Expand Up @@ -23,11 +23,6 @@
* questions.
*/

/* Access APIs for WinXP and above */
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
5 changes: 0 additions & 5 deletions src/java.base/windows/native/libjava/java_props_md.c
Expand Up @@ -23,11 +23,6 @@
* questions.
*/

/* Access APIs for Windows Vista and above */
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0601
#endif

#include "jni.h"
#include "jni_util.h"

Expand Down
6 changes: 1 addition & 5 deletions src/java.desktop/windows/native/libawt/windows/awt.h
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,10 +26,6 @@
#ifndef _AWT_H_
#define _AWT_H_

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif

#ifndef _WIN32_IE
#define _WIN32_IE 0x0600
#endif
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,11 +23,6 @@
* questions.
*/

// copy from awt.h
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif

// copy from awt.h
#ifndef _WIN32_IE
#define _WIN32_IE 0x0600
Expand Down

0 comments on commit e650bdc

Please sign in to comment.