Skip to content

Commit fb90af8

Browse files
8311380: Prepare java.desktop for C++17
Reviewed-by: azvegint
1 parent 743e8b8 commit fb90af8

File tree

14 files changed

+49
-62
lines changed

14 files changed

+49
-62
lines changed

src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
2627
#include <malloc.h>
27-
#include <math.h>
2828
#include <jlong.h>
2929

3030
#include "sun_java2d_d3d_D3DTextRenderer.h"

src/java.desktop/windows/native/libawt/java2d/d3d/D3DVertexCacher.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
27+
2628
#include "D3DPipeline.h"
2729
#include "D3DVertexCacher.h"
2830
#include "D3DPaints.h"
2931

30-
#include "math.h"
31-
3232
// non-texturized macros
3333

3434
#define ADD_VERTEX_XYC(X, Y, VCOLOR) \

src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath> /* for cos(), sin(), etc */
27+
2628
#include "jni_util.h"
2729
#include "awt.h"
2830
#include "sun_java2d_windows_GDIRenderer.h"
@@ -35,8 +37,6 @@
3537

3638
#include "GraphicsPrimitiveMgr.h"
3739

38-
#include <math.h> /* for cos(), sin(), etc */
39-
4040
#define MAX_CLAMP_BND (1<<26)
4141
#define MIN_CLAMP_BND (-MAX_CLAMP_BND)
4242

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
27+
2628
#include "sun_awt_windows_ThemeReader.h"
2729

2830
#include "awt.h"
2931
#include "awt_Toolkit.h"
3032

31-
#include "math.h"
32-
3333
#include <uxtheme.h>
3434

3535
#define ALPHA_MASK 0xff000000

src/java.desktop/windows/native/libawt/windows/alloc.h

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ ExceptionOccurred_Instead
8888
// These three functions throw std::bad_alloc in an out of memory condition
8989
// instead of returning 0. safe_Realloc will return 0 if memblock is not
9090
// NULL and size is 0. safe_Malloc and safe_Calloc will never return 0.
91-
void *safe_Malloc(size_t size) throw (std::bad_alloc);
92-
void *safe_Calloc(size_t num, size_t size) throw (std::bad_alloc);
93-
void *safe_Realloc(void *memblock, size_t size) throw (std::bad_alloc);
91+
void *safe_Malloc(size_t size);
92+
void *safe_Calloc(size_t num, size_t size);
93+
void *safe_Realloc(void *memblock, size_t size);
9494

9595
// This function should be called instead of ExceptionOccurred. It throws
9696
// std::bad_alloc if a java.lang.OutOfMemoryError is currently pending
9797
// on the calling thread.
98-
jthrowable safe_ExceptionOccurred(JNIEnv *env) throw (std::bad_alloc);
98+
jthrowable safe_ExceptionOccurred(JNIEnv *env);
9999

100100
// This function is called at the beginning of an entry point.
101101
// Entry points are functions which are declared:
@@ -111,7 +111,7 @@ void entry_point(void);
111111
void hang_if_shutdown(void);
112112

113113
// This function throws awt_toolkit_shutdown if the Toolkit is not active
114-
void throw_if_shutdown(void) throw (awt_toolkit_shutdown);
114+
void throw_if_shutdown(void);
115115

116116
// This function is called when a std::bad_alloc exception is caught
117117
void handle_bad_alloc(void);
@@ -120,14 +120,10 @@ void handle_bad_alloc(void);
120120
// #define OUTOFMEM_TEST
121121

122122
#ifdef OUTOFMEM_TEST
123-
void *safe_Malloc_outofmem(size_t size, const char *, int)
124-
throw (std::bad_alloc);
125-
void *safe_Calloc_outofmem(size_t num, size_t size, const char *, int)
126-
throw (std::bad_alloc);
127-
void *safe_Realloc_outofmem(void *memblock, size_t size, const char *, int)
128-
throw (std::bad_alloc);
129-
void * CDECL operator new(size_t size, const char *, int)
130-
throw (std::bad_alloc);
123+
void *safe_Malloc_outofmem(size_t size, const char *, int);
124+
void *safe_Calloc_outofmem(size_t num, size_t size, const char *, int);
125+
void *safe_Realloc_outofmem(void *memblock, size_t size, const char *, int);
126+
void * CDECL operator new(size_t size, const char *, int);
131127

132128
#define safe_Malloc(size) \
133129
safe_Malloc_outofmem(size, __FILE__, __LINE__)

src/java.desktop/windows/native/libawt/windows/awt_Component.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
27+
2628
#include "awt.h"
2729

2830
#include <windowsx.h>
@@ -47,7 +49,6 @@
4749
#include "awt_Win32GraphicsDevice.h"
4850
#include "Hashtable.h"
4951
#include "ComCtl32Util.h"
50-
#include "math.h"
5152

5253
#include <Region.h>
5354

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
27+
2628
#include "awt.h"
2729
#include "mmsystem.h"
2830
#include "jlong.h"
@@ -35,8 +37,6 @@
3537
#include <shellapi.h>
3638
#include <shlobj.h>
3739

38-
#include "math.h"
39-
4040
// WDesktopProperties fields
4141
jfieldID AwtDesktopProperties::pDataID = 0;
4242
jmethodID AwtDesktopProperties::setBooleanPropertyID = 0;

src/java.desktop/windows/native/libawt/windows/awt_Font.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
2627
#include "awt.h"
27-
#include <math.h>
2828
#include <strsafe.h>
2929
#include "jlong.h"
3030
#include "awt_Font.h"

src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
27+
#include <cfloat>
2628
#include "awt_Component.h"
2729
#include "awt_PrintControl.h"
2830
#include "awt.h"
2931
#include "awt_PrintDialog.h"
3032
#include <winspool.h>
31-
#include <float.h>
32-
#include <math.h>
3333

3434
#define ROUNDTOINT(x) ((int)((x)+0.5))
3535
static const int DEFAULT_RES = 72;

src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
* questions.
2424
*/
2525

26+
#include <cmath>
2627
#include "awt.h"
2728
#include <strsafe.h>
28-
#include <math.h>
2929
#include <windef.h>
3030
#include <wtypes.h>
3131
#include <winuser.h>

0 commit comments

Comments
 (0)