Skip to content

Commit 0530f4e

Browse files
committedJun 14, 2022
8288094: cleanup old _MSC_VER handling
Reviewed-by: mdoerr, clanger, aturbanov
1 parent 1a65332 commit 0530f4e

File tree

9 files changed

+14
-163
lines changed

9 files changed

+14
-163
lines changed
 

‎src/hotspot/os_cpu/windows_aarch64/unwind_windows_aarch64.hpp

+1-39
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Microsoft Corporation. All rights reserved.
2+
* Copyright (c) 2020, 2022, Microsoft Corporation. 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
@@ -28,15 +28,6 @@
2828

2929
typedef unsigned char UBYTE;
3030

31-
#if _MSC_VER < 1700
32-
33-
/* Not needed for VS2012 compiler, comes from winnt.h. */
34-
#define UNW_FLAG_EHANDLER 0x01
35-
#define UNW_FLAG_UHANDLER 0x02
36-
#define UNW_FLAG_CHAININFO 0x04
37-
38-
#endif
39-
4031
// See https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling#xdata-records
4132
typedef struct _UNWIND_INFO_EH_ONLY {
4233
DWORD FunctionLength : 18;
@@ -70,33 +61,4 @@ typedef struct _RUNTIME_FUNCTION {
7061
} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
7162
*/
7263

73-
#if _MSC_VER < 1700
74-
75-
/* Not needed for VS2012 compiler, comes from winnt.h. */
76-
typedef struct _DISPATCHER_CONTEXT {
77-
ULONG64 ControlPc;
78-
ULONG64 ImageBase;
79-
PRUNTIME_FUNCTION FunctionEntry;
80-
ULONG64 EstablisherFrame;
81-
ULONG64 TargetIp;
82-
PCONTEXT ContextRecord;
83-
// PEXCEPTION_ROUTINE LanguageHandler;
84-
char * LanguageHandler; // double dependency problem
85-
PVOID HandlerData;
86-
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
87-
88-
#endif
89-
90-
#if _MSC_VER < 1500
91-
92-
/* Not needed for VS2008 compiler, comes from winnt.h. */
93-
typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) (
94-
IN PEXCEPTION_RECORD ExceptionRecord,
95-
IN ULONG64 EstablisherFrame,
96-
IN OUT PCONTEXT ContextRecord,
97-
IN OUT PDISPATCHER_CONTEXT DispatcherContext
98-
);
99-
100-
#endif
101-
10264
#endif // OS_CPU_WINDOWS_AARCH64_UNWIND_WINDOWS_AARCH64_HPP
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 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
@@ -29,15 +29,6 @@
2929
#ifdef AMD64
3030
typedef unsigned char UBYTE;
3131

32-
#if _MSC_VER < 1700
33-
34-
/* Not needed for VS2012 compiler, comes from winnt.h. */
35-
#define UNW_FLAG_EHANDLER 0x01
36-
#define UNW_FLAG_UHANDLER 0x02
37-
#define UNW_FLAG_CHAININFO 0x04
38-
39-
#endif
40-
4132
// This structure is used to define an UNWIND_INFO that
4233
// only has an ExceptionHandler. There are no UnwindCodes
4334
// declared.
@@ -55,7 +46,6 @@ typedef struct _UNWIND_INFO_EH_ONLY {
5546
OPTIONAL ULONG ExceptionData[1];
5647
} UNWIND_INFO_EH_ONLY, *PUNWIND_INFO_EH_ONLY;
5748

58-
5949
/*
6050
typedef struct _RUNTIME_FUNCTION {
6151
ULONG BeginAddress;
@@ -64,35 +54,6 @@ typedef struct _RUNTIME_FUNCTION {
6454
} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
6555
*/
6656

67-
#if _MSC_VER < 1700
68-
69-
/* Not needed for VS2012 compiler, comes from winnt.h. */
70-
typedef struct _DISPATCHER_CONTEXT {
71-
ULONG64 ControlPc;
72-
ULONG64 ImageBase;
73-
PRUNTIME_FUNCTION FunctionEntry;
74-
ULONG64 EstablisherFrame;
75-
ULONG64 TargetIp;
76-
PCONTEXT ContextRecord;
77-
// PEXCEPTION_ROUTINE LanguageHandler;
78-
char * LanguageHandler; // double dependency problem
79-
PVOID HandlerData;
80-
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
81-
82-
#endif
83-
84-
#if _MSC_VER < 1500
85-
86-
/* Not needed for VS2008 compiler, comes from winnt.h. */
87-
typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) (
88-
IN PEXCEPTION_RECORD ExceptionRecord,
89-
IN ULONG64 EstablisherFrame,
90-
IN OUT PCONTEXT ContextRecord,
91-
IN OUT PDISPATCHER_CONTEXT DispatcherContext
92-
);
93-
94-
#endif
95-
9657
#endif // AMD64
9758

9859
#endif // OS_CPU_WINDOWS_X86_UNWIND_WINDOWS_X86_HPP

‎src/hotspot/share/adlc/adlc.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 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
@@ -42,13 +42,9 @@
4242
/* Make sure that we have the intptr_t and uintptr_t definitions */
4343
#ifdef _WIN32
4444

45-
#if _MSC_VER >= 1300
4645
using namespace std;
47-
#endif
4846

49-
#if _MSC_VER >= 1400
5047
#define strdup _strdup
51-
#endif
5248

5349
#if _MSC_VER < 1900
5450
#define snprintf _snprintf

‎src/hotspot/share/adlc/main.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,7 @@ int get_legal_text(FileBuff &fbuf, char **legal_text)
488488
return (int) (legal_end - legal_start);
489489
}
490490

491-
// VS2005 has its own definition, identical to this one.
492-
#if !defined(_WIN32) || defined(_WIN64) || _MSC_VER < 1400
491+
#if !defined(_WIN32) || defined(_WIN64)
493492
void *operator new( size_t size, int, const char *, int ) throw() {
494493
return ::operator new( size );
495494
}

‎src/hotspot/share/interpreter/bytecodes.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 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
@@ -29,16 +29,6 @@
2929
#include "utilities/align.hpp"
3030
#include "utilities/bytes.hpp"
3131

32-
33-
#if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
34-
// Windows AMD64 Compiler Hangs compiling this file
35-
// unless optimization is off
36-
#ifdef _M_AMD64
37-
#pragma optimize ("", off)
38-
#endif
39-
#endif
40-
41-
4232
bool Bytecodes::_is_initialized = false;
4333
const char* Bytecodes::_name [Bytecodes::number_of_codes];
4434
BasicType Bytecodes::_result_type [Bytecodes::number_of_codes];

‎src/java.base/share/native/launcher/main.c

+1-41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 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
@@ -34,46 +34,6 @@
3434
#include "jli_util.h"
3535
#include "jni.h"
3636

37-
#ifdef _MSC_VER
38-
#if _MSC_VER > 1400 && _MSC_VER < 1600
39-
40-
/*
41-
* When building for Microsoft Windows, main has a dependency on msvcr??.dll.
42-
*
43-
* When using Visual Studio 2005 or 2008, that must be recorded in
44-
* the [java,javaw].exe.manifest file.
45-
*
46-
* As of VS2010 (ver=1600), the runtimes again no longer need manifests.
47-
*
48-
* Reference:
49-
* C:/Program Files/Microsoft SDKs/Windows/v6.1/include/crtdefs.h
50-
*/
51-
#include <crtassem.h>
52-
#ifdef _M_IX86
53-
54-
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
55-
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \
56-
"version='" _CRT_ASSEMBLY_VERSION "' " \
57-
"processorArchitecture='x86' " \
58-
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
59-
60-
#endif /* _M_IX86 */
61-
62-
//This may not be necessary yet for the Windows 64-bit build, but it
63-
//will be when that build environment is updated. Need to test to see
64-
//if it is harmless:
65-
#ifdef _M_AMD64
66-
67-
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
68-
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \
69-
"version='" _CRT_ASSEMBLY_VERSION "' " \
70-
"processorArchitecture='amd64' " \
71-
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
72-
73-
#endif /* _M_AMD64 */
74-
#endif /* _MSC_VER > 1400 && _MSC_VER < 1600 */
75-
#endif /* _MSC_VER */
76-
7737
/*
7838
* Entry point.
7939
*/

‎src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 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
@@ -32,12 +32,6 @@
3232

3333
#include <uxtheme.h>
3434

35-
#if defined(_MSC_VER) && _MSC_VER >= 1800
36-
# define ROUND_TO_INT(num) ((int) round(num))
37-
#else
38-
# define ROUND_TO_INT(num) ((int) floor((num) + 0.5))
39-
#endif
40-
4135
#define ALPHA_MASK 0xff000000
4236
#define RED_MASK 0xff0000
4337
#define GREEN_MASK 0xff00
@@ -732,11 +726,11 @@ void rescale(SIZE *size) {
732726

733727
if (dpiX !=0 && dpiX != 96) {
734728
float invScaleX = 96.0f / dpiX;
735-
size->cx = ROUND_TO_INT(size->cx * invScaleX);
729+
size->cx = (int) round(size->cx * invScaleX);
736730
}
737731
if (dpiY != 0 && dpiY != 96) {
738732
float invScaleY = 96.0f / dpiY;
739-
size->cy = ROUND_TO_INT(size->cy * invScaleY);
733+
size->cy = (int) round(size->cy * invScaleY);
740734
}
741735
}
742736

‎src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 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
@@ -37,12 +37,6 @@
3737

3838
#include "math.h"
3939

40-
#if defined(_MSC_VER) && _MSC_VER >= 1800
41-
# define ROUND_TO_INT(num) ((int) round(num))
42-
#else
43-
# define ROUND_TO_INT(num) ((int) floor((num) + 0.5))
44-
#endif
45-
4640
// WDesktopProperties fields
4741
jfieldID AwtDesktopProperties::pDataID = 0;
4842
jmethodID AwtDesktopProperties::setBooleanPropertyID = 0;
@@ -103,7 +97,7 @@ void getInvScale(float &invScaleX, float &invScaleY) {
10397
}
10498

10599
int rescale(int value, float invScale){
106-
return invScale == 1.0f ? value : ROUND_TO_INT(value * invScale);
100+
return invScale == 1.0f ? value : (int) round(value * invScale);
107101
}
108102

109103
void AwtDesktopProperties::GetSystemProperties() {
@@ -286,7 +280,7 @@ void AwtDesktopProperties::GetNonClientParameters() {
286280
// when running on XP. However this can't be referenced at compile time
287281
// with the older SDK, so there use 'lfMessageFont' plus its size.
288282
if (!IS_WINVISTA) {
289-
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
283+
#if defined(_MSC_VER)
290284
ncmetrics.cbSize = offsetof(NONCLIENTMETRICS, iPaddedBorderWidth);
291285
#else
292286
ncmetrics.cbSize = offsetof(NONCLIENTMETRICS,lfMessageFont) + sizeof(LOGFONT);

‎src/java.desktop/windows/native/libawt/windows/awt_Window.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, 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
@@ -51,11 +51,6 @@
5151
typedef __int32 LONG_PTR;
5252
#endif // __int3264
5353

54-
#if defined(_MSC_VER) && _MSC_VER >= 1800
55-
# define ROUND_TO_INT(num) ((int) round(num))
56-
#else
57-
# define ROUND_TO_INT(num) ((int) floor((num) + 0.5))
58-
#endif
5954
// Used for Swing's Menu/Tooltip animation Support
6055
const int UNSPECIFIED = 0;
6156
const int TOOLTIP = 1;
@@ -3654,7 +3649,7 @@ int getSystemMetricValue(int msgType) {
36543649
}
36553650
if(dpi != 0 && dpi != 96) {
36563651
float invScaleX = 96.0f / dpi;
3657-
value = (int) ROUND_TO_INT(value * invScaleX);
3652+
value = (int) round(value * invScaleX);
36583653
}
36593654
return value;
36603655
}

0 commit comments

Comments
 (0)
Please sign in to comment.