Skip to content

Commit e650bdc

Browse files
committed
8285730: unify _WIN32_WINNT settings
Backport-of: 4fd79a6ad2683e4863bd4e311cb01cbc30ebf57f
1 parent cb294d9 commit e650bdc

File tree

7 files changed

+8
-31
lines changed

7 files changed

+8
-31
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
470470
ALWAYS_DEFINES_JVM="-D_REENTRANT"
471471
ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
472472
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
473-
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
473+
# Access APIs for Windows 8 and above
474+
# see https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
475+
ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602 -D_CRT_SECURE_NO_DEPRECATE \
474476
-D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
475-
ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN"
477+
ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0602"
476478
fi
477479
478480
###############################################################################

src/hotspot/os/windows/os_windows.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
*
2323
*/
2424

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

2827
// no precompiled headers
2928
#include "jvm.h"

src/java.base/windows/native/libjava/WinCAPISeedGenerator.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,6 @@
2323
* questions.
2424
*/
2525

26-
/* Need to define this to get CAPI functions included */
27-
#ifndef _WIN32_WINNT
28-
#define _WIN32_WINNT 0x0400
29-
#endif
30-
3126
#include <windows.h>
3227
#include <wincrypt.h>
3328
#include <jni.h>

src/java.base/windows/native/libjava/WinNTFileSystem_md.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
* questions.
2424
*/
2525

26-
/* Access APIs for WinXP and above */
27-
#ifndef _WIN32_WINNT
28-
#define _WIN32_WINNT 0x0501
29-
#endif
30-
3126
#include <assert.h>
3227
#include <stdio.h>
3328
#include <stdlib.h>

src/java.base/windows/native/libjava/java_props_md.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
* questions.
2424
*/
2525

26-
/* Access APIs for Windows Vista and above */
27-
#ifndef _WIN32_WINNT
28-
#define _WIN32_WINNT 0x0601
29-
#endif
30-
3126
#include "jni.h"
3227
#include "jni_util.h"
3328

src/java.desktop/windows/native/libawt/windows/awt.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,6 @@
2626
#ifndef _AWT_H_
2727
#define _AWT_H_
2828

29-
#ifndef _WIN32_WINNT
30-
#define _WIN32_WINNT 0x0600
31-
#endif
32-
3329
#ifndef _WIN32_IE
3430
#define _WIN32_IE 0x0600
3531
#endif

src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,11 +23,6 @@
2323
* questions.
2424
*/
2525

26-
// copy from awt.h
27-
#ifndef _WIN32_WINNT
28-
#define _WIN32_WINNT 0x0600
29-
#endif
30-
3126
// copy from awt.h
3227
#ifndef _WIN32_IE
3328
#define _WIN32_IE 0x0600

0 commit comments

Comments
 (0)