mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-11 19:14:54 +00:00
Rewrite fmt::throw_exception destructor
Add _DEBUG in debug mode for consistency with MSVC.
This commit is contained in:
parent
0070fce286
commit
e07484f057
@ -36,6 +36,8 @@ endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-DNDEBUG)
|
||||
elseif(NOT MSVC)
|
||||
add_definitions(-D_DEBUG)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
@ -297,7 +297,18 @@ namespace fmt
|
||||
raw_throw_exception({line, col, file, func}, reinterpret_cast<const char*>(fmt), type_list, fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
|
||||
}
|
||||
|
||||
[[noreturn]] ~throw_exception() { std::abort(); } // Unreachable
|
||||
#ifdef _DEBUG
|
||||
[[noreturn]] ~throw_exception()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
__assume(false);
|
||||
#else
|
||||
__builtin_unreachable();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
[[noreturn]] ~throw_exception();
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename CharT, usz N, typename... Args>
|
||||
|
Loading…
x
Reference in New Issue
Block a user