mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-04 07:09:51 +00:00
Workaround constinit in logs.cpp
Use unique_ptr wrapper
This commit is contained in:
parent
de0a16ab65
commit
c31cb216d2
1 changed files with 8 additions and 2 deletions
|
@ -397,8 +397,14 @@ void logs::message::broadcast(const char* fmt, const fmt_type_info* sup, ...) co
|
||||||
g_tls_log_control(fmt, 0);
|
g_tls_log_control(fmt, 0);
|
||||||
|
|
||||||
// Get text, extract va_args
|
// Get text, extract va_args
|
||||||
constinit thread_local std::string text;
|
constinit thread_local std::unique_ptr<std::string> text_;
|
||||||
constinit thread_local std::vector<u64> args;
|
constinit thread_local std::unique_ptr<std::vector<u64>> args_;
|
||||||
|
if (!text_)
|
||||||
|
text_ = std::make_unique<std::string>();
|
||||||
|
if (!args_)
|
||||||
|
args_ = std::make_unique<std::vector<u64>>();
|
||||||
|
auto& text = *text_.get();
|
||||||
|
auto& args = *args_.get();
|
||||||
|
|
||||||
static constexpr fmt_type_info empty_sup{};
|
static constexpr fmt_type_info empty_sup{};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue