Skip to content

Commit a289bcf

Browse files
8306579: Consider building with /Zc:throwingNew
Reviewed-by: ihse, kbarrett
1 parent cede304 commit a289bcf

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
564564
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
565565
# The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
566566
# compilation of all source files regardless of the active code page on Windows.
567-
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -MP"
568-
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -permissive- -utf-8 -Zc:wchar_t-"
567+
TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -utf-8 -MP"
568+
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -utf-8 -Zc:wchar_t-"
569569
fi
570570
571571
# CFLAGS C language level for JDK sources (hotspot only uses C++)

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,6 @@ void *safe_Realloc(void *memblock, size_t size) {
114114
return ptr;
115115
}
116116

117-
#if !defined(DEBUG)
118-
// This function exists because VC++ 5.0 currently does not conform to the
119-
// Standard C++ specification which requires that operator new throw
120-
// std::bad_alloc in an out of memory situation. Instead, VC++ 5.0 returns 0.
121-
//
122-
// This function can be safely removed when the problem is corrected.
123-
void * operator new(size_t size) {
124-
return safe_Malloc(size);
125-
}
126-
#endif
127-
128117
// This function is called at the beginning of an entry point.
129118
// Entry points are functions which are declared:
130119
// 1. CALLBACK,

0 commit comments

Comments
 (0)