mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Rewrite fmt::throw_exception destructor
Add _DEBUG in debug mode for consistency with MSVC.
This commit is contained in:
parent
0070fce286
commit
e07484f057
2 changed files with 14 additions and 1 deletions
|
@ -36,6 +36,8 @@ endif()
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
|
elseif(NOT MSVC)
|
||||||
|
add_definitions(-D_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
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)...});
|
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>
|
template <typename CharT, usz N, typename... Args>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue