Make RPCS3 compile in C++2a mode

This commit is contained in:
Nekotekina 2020-02-04 21:37:00 +03:00
parent e9e8f0c5b7
commit 1a78e0e80c
13 changed files with 141 additions and 109 deletions

View file

@ -68,6 +68,13 @@ namespace logs
{
}
private:
#if __cpp_char8_t >= 201811
using char2 = char8_t;
#else
using char2 = uchar;
#endif
#define GEN_LOG_METHOD(_sev)\
const message msg_##_sev{this, level::_sev};\
template <std::size_t N, typename... Args>\
@ -78,8 +85,18 @@ namespace logs
static constexpr fmt_type_info type_list[sizeof...(Args) + 1]{fmt_type_info::make<fmt_unveil_t<Args>>()...};\
msg_##_sev.broadcast(fmt, type_list, u64{fmt_unveil<Args>::get(args)}...);\
}\
}
}\
template <std::size_t N, typename... Args>\
void _sev(const char2(&fmt)[N], const Args&... args)\
{\
if (UNLIKELY(level::_sev <= enabled.load(std::memory_order_relaxed)))\
{\
static constexpr fmt_type_info type_list[sizeof...(Args) + 1]{fmt_type_info::make<fmt_unveil_t<Args>>()...};\
msg_##_sev.broadcast(reinterpret_cast<const char*>(+fmt), type_list, u64{fmt_unveil<Args>::get(args)}...);\
}\
}\
public:
GEN_LOG_METHOD(fatal)
GEN_LOG_METHOD(error)
GEN_LOG_METHOD(todo)