RFR: JDK-8285730: unify _WIN32_WINNT settings

Matthias Baesken mbaesken at openjdk.java.net
Thu Apr 28 07:19:42 UTC 2022


On Wed, 27 Apr 2022 14:57:41 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> Currently we set _WIN32_WINNT at various places in the codebase; this is used to target a minimum Windows version we want to support. See also for more detailled information :
> https://docs.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers?redirectedfrom=MSDN#setting-winver-or-_win32_winnt
> Macros for Conditional Declarations
> "Certain functions that depend on a particular version of Windows are declared using conditional code. This enables you to use the compiler to detect whether your application uses functions that are not supported on its target version(s) of Windows."
> 
> However currently we have quite a lot of differing settings of _WIN32_WINNT in the codebase ; setting _WIN32_WINNT to 0x0601 (Windows 7) where possible would make sense because we have this setting already at   java_props_md.c  (so targeting older Windows versions at other places is most likely not useful).

Hi Erik/David/Phil, we already have a good central place where we set the definition of WIN32_LEAN_AND_MEAN 

autoconf/flags-cflags.m4:460:    ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
autoconf/flags-cflags.m4:462:    ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN"

should we add there the _WIN32_WINNT=0x0601  define  (and remove the differing defines instead at the other places) ?
(defines of _WIN32_WINNT in 3rd party code would stay like wepoll.c and harfbuzz).

-------------

PR: https://git.openjdk.java.net/jdk/pull/8428



More information about the client-libs-dev mailing list