From c31cb216d2cfa272d26e0df1057a1b01df382f00 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 5 Nov 2024 21:51:31 +0300 Subject: [PATCH] Workaround constinit in logs.cpp Use unique_ptr wrapper --- rpcs3/util/logs.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rpcs3/util/logs.cpp b/rpcs3/util/logs.cpp index 42e355f75f..e08a687e8b 100644 --- a/rpcs3/util/logs.cpp +++ b/rpcs3/util/logs.cpp @@ -397,8 +397,14 @@ void logs::message::broadcast(const char* fmt, const fmt_type_info* sup, ...) co g_tls_log_control(fmt, 0); // Get text, extract va_args - constinit thread_local std::string text; - constinit thread_local std::vector args; + constinit thread_local std::unique_ptr text_; + constinit thread_local std::unique_ptr> args_; + if (!text_) + text_ = std::make_unique(); + if (!args_) + args_ = std::make_unique>(); + auto& text = *text_.get(); + auto& args = *args_.get(); static constexpr fmt_type_info empty_sup{};