mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-13 07:14:49 +00:00
Fix code relying on initialization order
Allows Debug - LLVM to boot
This commit is contained in:
parent
aeebcfe141
commit
9f678cc47a
@ -629,7 +629,7 @@ logs::file_listener::file_listener(const std::string& name)
|
|||||||
ver.m.ch = nullptr;
|
ver.m.ch = nullptr;
|
||||||
ver.m.sev = level::always;
|
ver.m.sev = level::always;
|
||||||
ver.stamp = 0;
|
ver.stamp = 0;
|
||||||
ver.text = fmt::format("RPCS3 v%s | %s%s\n%s", rpcs3::version.to_string(), rpcs3::get_branch(), firmware_string, utils::get_system_info());
|
ver.text = fmt::format("RPCS3 v%s | %s%s\n%s", rpcs3::get_version().to_string(), rpcs3::get_branch(), firmware_string, utils::get_system_info());
|
||||||
|
|
||||||
file_writer::log(logs::level::always, ver.text.data(), ver.text.size());
|
file_writer::log(logs::level::always, ver.text.data(), ver.text.size());
|
||||||
file_writer::log(logs::level::always, "\n", 1);
|
file_writer::log(logs::level::always, "\n", 1);
|
||||||
|
@ -221,7 +221,7 @@ int main(int argc, char** argv)
|
|||||||
const bool use_cli_style = find_arg(arg_style, argc, argv) || find_arg(arg_stylesheet, argc, argv);
|
const bool use_cli_style = find_arg(arg_style, argc, argv) || find_arg(arg_stylesheet, argc, argv);
|
||||||
|
|
||||||
QScopedPointer<QCoreApplication> app(createApplication(argc, argv));
|
QScopedPointer<QCoreApplication> app(createApplication(argc, argv));
|
||||||
app->setApplicationVersion(qstr(rpcs3::version.to_string()));
|
app->setApplicationVersion(qstr(rpcs3::get_version().to_string()));
|
||||||
app->setApplicationName("RPCS3");
|
app->setApplicationName("RPCS3");
|
||||||
|
|
||||||
// Command line args
|
// Command line args
|
||||||
|
@ -21,5 +21,9 @@ namespace rpcs3
|
|||||||
|
|
||||||
// TODO: Make this accessible from cmake and keep in sync with MACOSX_BUNDLE_BUNDLE_VERSION.
|
// TODO: Make this accessible from cmake and keep in sync with MACOSX_BUNDLE_BUNDLE_VERSION.
|
||||||
// Currently accessible by Windows and Linux build scripts, see implementations when doing MACOSX
|
// Currently accessible by Windows and Linux build scripts, see implementations when doing MACOSX
|
||||||
const extern utils::version version{ 0, 0, 8, utils::version_type::alpha, 1, RPCS3_GIT_VERSION };
|
const utils::version& get_version()
|
||||||
|
{
|
||||||
|
static constexpr utils::version version{ 0, 0, 8, utils::version_type::alpha, 1, RPCS3_GIT_VERSION };
|
||||||
|
return version;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,5 @@ namespace rpcs3
|
|||||||
{
|
{
|
||||||
std::string get_branch();
|
std::string get_branch();
|
||||||
std::pair<std::string, std::string> get_commit_and_hash();
|
std::pair<std::string, std::string> get_commit_and_hash();
|
||||||
|
const utils::version& get_version();
|
||||||
extern const utils::version version;
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ about_dialog::about_dialog(QWidget* parent) : QDialog(parent), ui(new Ui::about_
|
|||||||
|
|
||||||
ui->close->setDefault(true);
|
ui->close->setDefault(true);
|
||||||
|
|
||||||
ui->version->setText(tr("RPCS3 Version: %1").arg(qstr(rpcs3::version.to_string())));
|
ui->version->setText(tr("RPCS3 Version: %1").arg(qstr(rpcs3::get_version().to_string())));
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
connect(ui->gitHub, &QPushButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.github.com/RPCS3")); });
|
connect(ui->gitHub, &QPushButton::clicked, [] { QDesktopServices::openUrl(QUrl("https://www.github.com/RPCS3")); });
|
||||||
|
@ -39,13 +39,13 @@ gs_frame::gs_frame(const QString& title, const QRect& geometry, const QIcon& app
|
|||||||
m_disable_mouse = gui_settings->GetValue(gui::gs_disableMouse).toBool();
|
m_disable_mouse = gui_settings->GetValue(gui::gs_disableMouse).toBool();
|
||||||
|
|
||||||
// Get version by substringing VersionNumber-buildnumber-commithash to get just the part before the dash
|
// Get version by substringing VersionNumber-buildnumber-commithash to get just the part before the dash
|
||||||
std::string version = rpcs3::version.to_string();
|
std::string version = rpcs3::get_version().to_string();
|
||||||
version = version.substr(0 , version.find_last_of('-'));
|
version = version.substr(0 , version.find_last_of('-'));
|
||||||
|
|
||||||
// Add branch and commit hash to version on frame unless it's master.
|
// Add branch and commit hash to version on frame unless it's master.
|
||||||
if ((rpcs3::get_branch().compare("master") != 0) && (rpcs3::get_branch().compare("HEAD") != 0))
|
if ((rpcs3::get_branch().compare("master") != 0) && (rpcs3::get_branch().compare("HEAD") != 0))
|
||||||
{
|
{
|
||||||
version = version + "-" + rpcs3::version.to_string().substr((rpcs3::version.to_string().find_last_of('-') + 1), 8) + "-" + rpcs3::get_branch();
|
version = version + "-" + rpcs3::get_version().to_string().substr((rpcs3::get_version().to_string().find_last_of('-') + 1), 8) + "-" + rpcs3::get_branch();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_windowTitle += qstr(" | " + version);
|
m_windowTitle += qstr(" | " + version);
|
||||||
|
@ -94,7 +94,7 @@ void main_window::Init()
|
|||||||
CreateConnects();
|
CreateConnects();
|
||||||
|
|
||||||
setMinimumSize(350, minimumSizeHint().height()); // seems fine on win 10
|
setMinimumSize(350, minimumSizeHint().height()); // seems fine on win 10
|
||||||
setWindowTitle(QString::fromStdString("RPCS3 " + rpcs3::version.to_string()));
|
setWindowTitle(QString::fromStdString("RPCS3 " + rpcs3::get_version().to_string()));
|
||||||
|
|
||||||
Q_EMIT RequestGlobalStylesheetChange(guiSettings->GetCurrentStylesheetPath());
|
Q_EMIT RequestGlobalStylesheetChange(guiSettings->GetCurrentStylesheetPath());
|
||||||
ConfigureGuiFromSettings(true);
|
ConfigureGuiFromSettings(true);
|
||||||
|
@ -79,7 +79,7 @@ namespace stx
|
|||||||
// Destroy all objects and keep them in uninitialized state, must be called first
|
// Destroy all objects and keep them in uninitialized state, must be called first
|
||||||
void reset() noexcept
|
void reset() noexcept
|
||||||
{
|
{
|
||||||
const auto total_count = stx::typelist_v<typeinfo>.count();
|
const auto total_count = stx::typelist<typeinfo>().count();
|
||||||
|
|
||||||
if (!m_list)
|
if (!m_list)
|
||||||
{
|
{
|
||||||
@ -96,13 +96,13 @@ namespace stx
|
|||||||
void(*destroy)(void*& ptr) noexcept;
|
void(*destroy)(void*& ptr) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto all_data = std::make_unique<destroy_info[]>(stx::typelist_v<typeinfo>.count());
|
auto all_data = std::make_unique<destroy_info[]>(stx::typelist<typeinfo>().count());
|
||||||
|
|
||||||
// Actual number of created objects
|
// Actual number of created objects
|
||||||
unsigned _max = 0;
|
unsigned _max = 0;
|
||||||
|
|
||||||
// Create destroy list
|
// Create destroy list
|
||||||
for (auto& type : stx::typelist_v<typeinfo>)
|
for (auto& type : stx::typelist<typeinfo>())
|
||||||
{
|
{
|
||||||
if (m_order[type.index()] == 0)
|
if (m_order[type.index()] == 0)
|
||||||
{
|
{
|
||||||
@ -136,7 +136,7 @@ namespace stx
|
|||||||
// Default initialize all objects if possible and not already initialized
|
// Default initialize all objects if possible and not already initialized
|
||||||
void init() noexcept
|
void init() noexcept
|
||||||
{
|
{
|
||||||
for (auto& type : stx::typelist_v<typeinfo>)
|
for (auto& type : stx::typelist<typeinfo>())
|
||||||
{
|
{
|
||||||
type.create(m_list[type.index()]);
|
type.create(m_list[type.index()]);
|
||||||
|
|
||||||
|
@ -112,16 +112,21 @@ namespace stx
|
|||||||
|
|
||||||
// Global typecounter instance
|
// Global typecounter instance
|
||||||
template <typename Info>
|
template <typename Info>
|
||||||
inline type_counter<Info> typelist_v{};
|
auto& typelist()
|
||||||
|
{
|
||||||
|
static type_counter<Info> typelist_v;
|
||||||
|
return typelist_v;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Info>
|
template <typename Info>
|
||||||
type_info<Info>::type_info(Info info, decltype(sizeof(int))) noexcept
|
type_info<Info>::type_info(Info info, decltype(sizeof(int))) noexcept
|
||||||
: Info(info)
|
: Info(info)
|
||||||
, type(typelist_v<Info>.count())
|
, type(typelist<Info>().count())
|
||||||
{
|
{
|
||||||
// Update linked list
|
// Update linked list
|
||||||
typelist_v<Info>.next->next = this;
|
auto& tl = typelist<Info>();
|
||||||
typelist_v<Info>.next = this;
|
tl.next->next = this;
|
||||||
|
tl.next = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type index accessor
|
// Type index accessor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user