8288094: cleanup old _MSC_VER handling
Reviewed-by: mdoerr, clanger, aturbanov
This commit is contained in:
parent
1a6533225d
commit
0530f4e517
src
hotspot
os_cpu
share
java.base/share/native/launcher
java.desktop/windows/native/libawt/windows
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Microsoft Corporation. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Microsoft Corporation. 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
|
||||
@ -28,15 +28,6 @@
|
||||
|
||||
typedef unsigned char UBYTE;
|
||||
|
||||
#if _MSC_VER < 1700
|
||||
|
||||
/* Not needed for VS2012 compiler, comes from winnt.h. */
|
||||
#define UNW_FLAG_EHANDLER 0x01
|
||||
#define UNW_FLAG_UHANDLER 0x02
|
||||
#define UNW_FLAG_CHAININFO 0x04
|
||||
|
||||
#endif
|
||||
|
||||
// See https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling#xdata-records
|
||||
typedef struct _UNWIND_INFO_EH_ONLY {
|
||||
DWORD FunctionLength : 18;
|
||||
@ -70,33 +61,4 @@ typedef struct _RUNTIME_FUNCTION {
|
||||
} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
|
||||
*/
|
||||
|
||||
#if _MSC_VER < 1700
|
||||
|
||||
/* Not needed for VS2012 compiler, comes from winnt.h. */
|
||||
typedef struct _DISPATCHER_CONTEXT {
|
||||
ULONG64 ControlPc;
|
||||
ULONG64 ImageBase;
|
||||
PRUNTIME_FUNCTION FunctionEntry;
|
||||
ULONG64 EstablisherFrame;
|
||||
ULONG64 TargetIp;
|
||||
PCONTEXT ContextRecord;
|
||||
// PEXCEPTION_ROUTINE LanguageHandler;
|
||||
char * LanguageHandler; // double dependency problem
|
||||
PVOID HandlerData;
|
||||
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
|
||||
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1500
|
||||
|
||||
/* Not needed for VS2008 compiler, comes from winnt.h. */
|
||||
typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) (
|
||||
IN PEXCEPTION_RECORD ExceptionRecord,
|
||||
IN ULONG64 EstablisherFrame,
|
||||
IN OUT PCONTEXT ContextRecord,
|
||||
IN OUT PDISPATCHER_CONTEXT DispatcherContext
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#endif // OS_CPU_WINDOWS_AARCH64_UNWIND_WINDOWS_AARCH64_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 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
|
||||
@ -29,15 +29,6 @@
|
||||
#ifdef AMD64
|
||||
typedef unsigned char UBYTE;
|
||||
|
||||
#if _MSC_VER < 1700
|
||||
|
||||
/* Not needed for VS2012 compiler, comes from winnt.h. */
|
||||
#define UNW_FLAG_EHANDLER 0x01
|
||||
#define UNW_FLAG_UHANDLER 0x02
|
||||
#define UNW_FLAG_CHAININFO 0x04
|
||||
|
||||
#endif
|
||||
|
||||
// This structure is used to define an UNWIND_INFO that
|
||||
// only has an ExceptionHandler. There are no UnwindCodes
|
||||
// declared.
|
||||
@ -55,7 +46,6 @@ typedef struct _UNWIND_INFO_EH_ONLY {
|
||||
OPTIONAL ULONG ExceptionData[1];
|
||||
} UNWIND_INFO_EH_ONLY, *PUNWIND_INFO_EH_ONLY;
|
||||
|
||||
|
||||
/*
|
||||
typedef struct _RUNTIME_FUNCTION {
|
||||
ULONG BeginAddress;
|
||||
@ -64,35 +54,6 @@ typedef struct _RUNTIME_FUNCTION {
|
||||
} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
|
||||
*/
|
||||
|
||||
#if _MSC_VER < 1700
|
||||
|
||||
/* Not needed for VS2012 compiler, comes from winnt.h. */
|
||||
typedef struct _DISPATCHER_CONTEXT {
|
||||
ULONG64 ControlPc;
|
||||
ULONG64 ImageBase;
|
||||
PRUNTIME_FUNCTION FunctionEntry;
|
||||
ULONG64 EstablisherFrame;
|
||||
ULONG64 TargetIp;
|
||||
PCONTEXT ContextRecord;
|
||||
// PEXCEPTION_ROUTINE LanguageHandler;
|
||||
char * LanguageHandler; // double dependency problem
|
||||
PVOID HandlerData;
|
||||
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
|
||||
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1500
|
||||
|
||||
/* Not needed for VS2008 compiler, comes from winnt.h. */
|
||||
typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) (
|
||||
IN PEXCEPTION_RECORD ExceptionRecord,
|
||||
IN ULONG64 EstablisherFrame,
|
||||
IN OUT PCONTEXT ContextRecord,
|
||||
IN OUT PDISPATCHER_CONTEXT DispatcherContext
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#endif // AMD64
|
||||
|
||||
#endif // OS_CPU_WINDOWS_X86_UNWIND_WINDOWS_X86_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -42,13 +42,9 @@
|
||||
/* Make sure that we have the intptr_t and uintptr_t definitions */
|
||||
#ifdef _WIN32
|
||||
|
||||
#if _MSC_VER >= 1300
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
|
@ -488,8 +488,7 @@ int get_legal_text(FileBuff &fbuf, char **legal_text)
|
||||
return (int) (legal_end - legal_start);
|
||||
}
|
||||
|
||||
// VS2005 has its own definition, identical to this one.
|
||||
#if !defined(_WIN32) || defined(_WIN64) || _MSC_VER < 1400
|
||||
#if !defined(_WIN32) || defined(_WIN64)
|
||||
void *operator new( size_t size, int, const char *, int ) throw() {
|
||||
return ::operator new( size );
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -29,16 +29,6 @@
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/bytes.hpp"
|
||||
|
||||
|
||||
#if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600))
|
||||
// Windows AMD64 Compiler Hangs compiling this file
|
||||
// unless optimization is off
|
||||
#ifdef _M_AMD64
|
||||
#pragma optimize ("", off)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
bool Bytecodes::_is_initialized = false;
|
||||
const char* Bytecodes::_name [Bytecodes::number_of_codes];
|
||||
BasicType Bytecodes::_result_type [Bytecodes::number_of_codes];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 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
|
||||
@ -34,46 +34,6 @@
|
||||
#include "jli_util.h"
|
||||
#include "jni.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER > 1400 && _MSC_VER < 1600
|
||||
|
||||
/*
|
||||
* When building for Microsoft Windows, main has a dependency on msvcr??.dll.
|
||||
*
|
||||
* When using Visual Studio 2005 or 2008, that must be recorded in
|
||||
* the [java,javaw].exe.manifest file.
|
||||
*
|
||||
* As of VS2010 (ver=1600), the runtimes again no longer need manifests.
|
||||
*
|
||||
* Reference:
|
||||
* C:/Program Files/Microsoft SDKs/Windows/v6.1/include/crtdefs.h
|
||||
*/
|
||||
#include <crtassem.h>
|
||||
#ifdef _M_IX86
|
||||
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
|
||||
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \
|
||||
"version='" _CRT_ASSEMBLY_VERSION "' " \
|
||||
"processorArchitecture='x86' " \
|
||||
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
|
||||
|
||||
#endif /* _M_IX86 */
|
||||
|
||||
//This may not be necessary yet for the Windows 64-bit build, but it
|
||||
//will be when that build environment is updated. Need to test to see
|
||||
//if it is harmless:
|
||||
#ifdef _M_AMD64
|
||||
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' " \
|
||||
"name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \
|
||||
"version='" _CRT_ASSEMBLY_VERSION "' " \
|
||||
"processorArchitecture='amd64' " \
|
||||
"publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
|
||||
|
||||
#endif /* _M_AMD64 */
|
||||
#endif /* _MSC_VER > 1400 && _MSC_VER < 1600 */
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/*
|
||||
* Entry point.
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -32,12 +32,6 @@
|
||||
|
||||
#include <uxtheme.h>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1800
|
||||
# define ROUND_TO_INT(num) ((int) round(num))
|
||||
#else
|
||||
# define ROUND_TO_INT(num) ((int) floor((num) + 0.5))
|
||||
#endif
|
||||
|
||||
#define ALPHA_MASK 0xff000000
|
||||
#define RED_MASK 0xff0000
|
||||
#define GREEN_MASK 0xff00
|
||||
@ -732,11 +726,11 @@ void rescale(SIZE *size) {
|
||||
|
||||
if (dpiX !=0 && dpiX != 96) {
|
||||
float invScaleX = 96.0f / dpiX;
|
||||
size->cx = ROUND_TO_INT(size->cx * invScaleX);
|
||||
size->cx = (int) round(size->cx * invScaleX);
|
||||
}
|
||||
if (dpiY != 0 && dpiY != 96) {
|
||||
float invScaleY = 96.0f / dpiY;
|
||||
size->cy = ROUND_TO_INT(size->cy * invScaleY);
|
||||
size->cy = (int) round(size->cy * invScaleY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 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
|
||||
@ -37,12 +37,6 @@
|
||||
|
||||
#include "math.h"
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1800
|
||||
# define ROUND_TO_INT(num) ((int) round(num))
|
||||
#else
|
||||
# define ROUND_TO_INT(num) ((int) floor((num) + 0.5))
|
||||
#endif
|
||||
|
||||
// WDesktopProperties fields
|
||||
jfieldID AwtDesktopProperties::pDataID = 0;
|
||||
jmethodID AwtDesktopProperties::setBooleanPropertyID = 0;
|
||||
@ -103,7 +97,7 @@ void getInvScale(float &invScaleX, float &invScaleY) {
|
||||
}
|
||||
|
||||
int rescale(int value, float invScale){
|
||||
return invScale == 1.0f ? value : ROUND_TO_INT(value * invScale);
|
||||
return invScale == 1.0f ? value : (int) round(value * invScale);
|
||||
}
|
||||
|
||||
void AwtDesktopProperties::GetSystemProperties() {
|
||||
@ -286,7 +280,7 @@ void AwtDesktopProperties::GetNonClientParameters() {
|
||||
// when running on XP. However this can't be referenced at compile time
|
||||
// with the older SDK, so there use 'lfMessageFont' plus its size.
|
||||
if (!IS_WINVISTA) {
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
#if defined(_MSC_VER)
|
||||
ncmetrics.cbSize = offsetof(NONCLIENTMETRICS, iPaddedBorderWidth);
|
||||
#else
|
||||
ncmetrics.cbSize = offsetof(NONCLIENTMETRICS,lfMessageFont) + sizeof(LOGFONT);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2020, 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
|
||||
@ -51,11 +51,6 @@
|
||||
typedef __int32 LONG_PTR;
|
||||
#endif // __int3264
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1800
|
||||
# define ROUND_TO_INT(num) ((int) round(num))
|
||||
#else
|
||||
# define ROUND_TO_INT(num) ((int) floor((num) + 0.5))
|
||||
#endif
|
||||
// Used for Swing's Menu/Tooltip animation Support
|
||||
const int UNSPECIFIED = 0;
|
||||
const int TOOLTIP = 1;
|
||||
@ -3654,7 +3649,7 @@ int getSystemMetricValue(int msgType) {
|
||||
}
|
||||
if(dpi != 0 && dpi != 96) {
|
||||
float invScaleX = 96.0f / dpi;
|
||||
value = (int) ROUND_TO_INT(value * invScaleX);
|
||||
value = (int) round(value * invScaleX);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user