diff --git a/stl/inc/memory b/stl/inc/memory index 73ea02bb84..550ee7ca21 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -1126,11 +1126,11 @@ private: #ifdef _M_CEE_PURE // permanent workaround to avoid mentioning _purecall in msvcurt.lib, ptrustu.lib, or other support libs virtual void _Destroy() noexcept { - _STD terminate(); + _CSTD abort(); } virtual void _Delete_this() noexcept { - _STD terminate(); + _CSTD abort(); } #else // ^^^ _M_CEE_PURE / !_M_CEE_PURE vvv virtual void _Destroy() noexcept = 0; // destroy managed resource diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index 12c88d7278..89f4dd79ab 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -171,7 +171,7 @@ _STL_DISABLE_CLANG_WARNINGS #ifndef _STL_CRT_SECURE_INVALID_PARAMETER #ifdef _STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER -#define _STL_CRT_SECURE_INVALID_PARAMETER(expr) ::abort() +#define _STL_CRT_SECURE_INVALID_PARAMETER(expr) _CSTD abort() #elif defined(_DEBUG) // avoid emitting unused long strings for function names; see GH-1956 #define _STL_CRT_SECURE_INVALID_PARAMETER(expr) ::_invalid_parameter(_CRT_WIDE(#expr), L"", __FILEW__, __LINE__, 0) #else // _DEBUG diff --git a/stl/src/excptptr.cpp b/stl/src/excptptr.cpp index 75aeac6589..bc5402f66e 100644 --- a/stl/src/excptptr.cpp +++ b/stl/src/excptptr.cpp @@ -81,7 +81,7 @@ namespace { alignas(_Ty) static unsigned char _Storage[sizeof(_Ty)]; if (!_Execute_once(_Flag, _Immortalize_impl<_Ty>, &_Storage)) { // _Execute_once should never fail if the callback never fails - _STD terminate(); + _CSTD abort(); } return reinterpret_cast<_Ty&>(_Storage); @@ -255,7 +255,7 @@ namespace { const auto _PThrow = _CppEhRecord.params.pThrowInfo; if (!_PThrow) { // No ThrowInfo exists. If this was a C++ exception, something must have corrupted it. - abort(); + _CSTD abort(); } if (!_CppEhRecord.params.pExceptionObject) { @@ -489,7 +489,7 @@ _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCurrentException(void* const auto _PThrow = _CppRecord.params.pThrowInfo; if (!_CppRecord.params.pExceptionObject || !_PThrow || !_PThrow->pCatchableTypeArray) { // Missing or corrupt ThrowInfo. If this was a C++ exception, something must have corrupted it. - abort(); + _CSTD abort(); } #if _EH_RELATIVE_TYPEINFO @@ -502,7 +502,7 @@ _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCurrentException(void* if (_CatchableTypeArray->nCatchableTypes <= 0) { // Ditto corrupted. - abort(); + _CSTD abort(); } // we finally got the type info we want diff --git a/stl/src/filesystem.cpp b/stl/src/filesystem.cpp index 959f40be8f..84b20ed350 100644 --- a/stl/src/filesystem.cpp +++ b/stl/src/filesystem.cpp @@ -207,7 +207,7 @@ _EXTERN_C void __stdcall __std_fs_close_handle(const __std_fs_file_handle _Handle) noexcept { // calls CloseHandle if (_Handle != __std_fs_file_handle::_Invalid && !CloseHandle(reinterpret_cast(_Handle))) { - terminate(); + _CSTD abort(); } } @@ -252,7 +252,7 @@ static_assert(alignof(WIN32_FIND_DATAW) == alignof(__std_fs_find_data)); void __stdcall __std_fs_directory_iterator_close(_In_ const __std_fs_dir_handle _Handle) noexcept { if (_Handle != __std_fs_dir_handle::_Invalid && !FindClose(reinterpret_cast(_Handle))) { - terminate(); + _CSTD abort(); } } diff --git a/stl/src/iosptrs.cpp b/stl/src/iosptrs.cpp index 0348c81891..179220547d 100644 --- a/stl/src/iosptrs.cpp +++ b/stl/src/iosptrs.cpp @@ -36,7 +36,7 @@ __PURE_APPDOMAIN_GLOBAL static void(__cdecl* atfuns_cdecl[_Nats])() = {}; __PURE_APPDOMAIN_GLOBAL static size_t atcount_cdecl = _Nats; _MRTIMP2 void __cdecl _Atexit(void(__cdecl* pf)()) { // add to wrapup list if (atcount_cdecl == 0) { - abort(); // stack full, give up + _CSTD abort(); // stack full, give up } else { atfuns_cdecl[--atcount_cdecl] = reinterpret_cast(EncodePointer(reinterpret_cast(pf))); } diff --git a/stl/src/primitives.hpp b/stl/src/primitives.hpp index 4a1cb66662..494eb7eb12 100644 --- a/stl/src/primitives.hpp +++ b/stl/src/primitives.hpp @@ -20,7 +20,7 @@ namespace Concurrency { void wait(_Stl_critical_section* lock) { if (!wait_for(lock, INFINITE)) { - std::terminate(); + _CSTD abort(); } }