Navigation Menu

Skip to content

Commit

Permalink
8285730: unify _WIN32_WINNT settings
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, erikj, ihse, prr, alanb
  • Loading branch information
MBaesken committed May 10, 2022
1 parent bd6026c commit 4fd79a6
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 @@ -457,9 +457,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

3 comments on commit 4fd79a6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 4fd79a6 Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken the backport was successfully created on the branch MBaesken-backport-4fd79a6a in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 4fd79a6a from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 10 May 2022 and was reviewed by David Holmes, Erik Joelsson, Magnus Ihse Bursie, Phil Race and Alan Bateman.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev MBaesken-backport-4fd79a6a:MBaesken-backport-4fd79a6a
$ git checkout MBaesken-backport-4fd79a6a
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev MBaesken-backport-4fd79a6a

Please sign in to comment.