mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Disable exception handling.
Use -fno-exceptions in cmake. On MSVC, enable _HAS_EXCEPTION=0. Cleanup throw/catch from the source. Create yaml.cpp enclave because it needs exception to work. Disable thread_local optimizations in logs.cpp (TODO). Implement cpu_counter for cpu_threads (moved globals).
This commit is contained in:
parent
47bbfdd2aa
commit
04dedb17eb
39 changed files with 421 additions and 437 deletions
10
rpcs3/util/cereal.cpp
Normal file
10
rpcs3/util/cereal.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include <string>
|
||||
#include "Utilities/Thread.h"
|
||||
|
||||
namespace cereal
|
||||
{
|
||||
[[noreturn]] void throw_exception(const std::string& err)
|
||||
{
|
||||
report_fatal_error(err);
|
||||
}
|
||||
}
|
||||
|
|
@ -307,8 +307,8 @@ void logs::message::broadcast(const char* fmt, const fmt_type_info* sup, ...) co
|
|||
const u64 stamp = get_stamp();
|
||||
|
||||
// Get text, extract va_args
|
||||
thread_local std::string text;
|
||||
thread_local std::vector<u64> args;
|
||||
/*constinit thread_local*/ std::string text;
|
||||
/*constinit thread_local*/ std::basic_string<u64> args;
|
||||
|
||||
static constexpr fmt_type_info empty_sup{};
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ void logs::message::broadcast(const char* fmt, const fmt_type_info* sup, ...) co
|
|||
for (auto v = sup; v && v->fmt_string; v++)
|
||||
args_count++;
|
||||
|
||||
text.clear();
|
||||
text.reserve(50000);
|
||||
args.resize(args_count);
|
||||
|
||||
va_list c_args;
|
||||
|
|
@ -589,7 +589,8 @@ logs::file_listener::file_listener(const std::string& path, u64 max_size)
|
|||
|
||||
void logs::file_listener::log(u64 stamp, const logs::message& msg, const std::string& prefix, const std::string& _text)
|
||||
{
|
||||
thread_local std::string text;
|
||||
/*constinit thread_local*/ std::string text;
|
||||
text.reserve(50000);
|
||||
|
||||
// Used character: U+00B7 (Middle Dot)
|
||||
switch (msg.sev)
|
||||
|
|
|
|||
17
rpcs3/util/yaml.cpp
Normal file
17
rpcs3/util/yaml.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "util/yaml.hpp"
|
||||
|
||||
std::pair<YAML::Node, std::string> yaml_load(const std::string& from)
|
||||
{
|
||||
YAML::Node result;
|
||||
|
||||
try
|
||||
{
|
||||
result = YAML::Load(from);
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
return{YAML::Node(), std::string("YAML exception:\n") + e.what()};
|
||||
}
|
||||
|
||||
return{result, ""};
|
||||
}
|
||||
20
rpcs3/util/yaml.hpp
Normal file
20
rpcs3/util/yaml.hpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
#include <string>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push, 0)
|
||||
#include "yaml-cpp/yaml.h"
|
||||
#pragma warning(pop)
|
||||
#else
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wall"
|
||||
#pragma GCC diagnostic ignored "-Wextra"
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#include "yaml-cpp/yaml.h"
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
// Load from string and consume exception
|
||||
std::pair<YAML::Node, std::string> yaml_load(const std::string& from);
|
||||
Loading…
Add table
Add a link
Reference in a new issue