RFR: JDK-8288094: cleanup old _MSC_VER handling
Phil Race
prr at openjdk.java.net
Fri Jun 10 21:08:03 UTC 2022
On Thu, 9 Jun 2022 11:37:21 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> We still handle at a number of places ancient historic _MSC_VER versions of Visual Studio releases e.g. pre VS2013 (VS2013 has _MSC_VER 1800).
> This should be cleaned up, as long as it is not 3rd party code that we don't want to adjust.
>
> Currently still supported ("valid") VS version are 2017+, see https://github.com/openjdk/jdk/blob/master/make/autoconf/toolchain_microsoft.m4 .
> VALID_VS_VERSIONS="2019 2017 2022"
> Even with adjusted toolchain m4 files, something older than VS2013 (also probably older than VS2015) would not be able to build jdk anymore.
src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp line 38:
> 36: # define ROUND_TO_INT(num) ((int) round(num))
> 37: #else
> 38: # define ROUND_TO_INT(num) ((int) floor((num) + 0.5))
If you look at when and why this was introduced (*), the "else" was not to support some other compiler - it was to support the older MS compiler. So if you don't want that, then the whole thing reduces to
#define ROUND_TO_INT(num) ((int) round(num))
.. you could even go further and eliminate the macro altogether if it makes sense - you'd have to look at the usages.
Same logic applies to the other files.
(*) https://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010889.html
-------------
PR: https://git.openjdk.org/jdk/pull/9105
More information about the core-libs-dev
mailing list