Compare commits

...

3 Commits

Author SHA1 Message Date
Caio Oliveira
4002061664 [hle] windows dont like it
* and a wrapper only for debug msg is not necessary
2025-12-26 02:43:08 +01:00
Caio Oliveira
cfb4790a27 [hle] fix build
Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
2025-12-26 02:43:08 +01:00
lizzie
fcbf68fb7c [cmake, common] allow build with -fno-rtti and /GR-, to disable gen of rtti and save some bytes in vtables
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2025-12-26 02:43:08 +01:00
5 changed files with 22 additions and 13 deletions

View File

@@ -87,6 +87,10 @@ if (MSVC AND NOT CXX_CLANG)
/wd4324 # 'struct_name': structure was padded due to __declspec(align()) /wd4324 # 'struct_name': structure was padded due to __declspec(align())
/wd4201 # nonstandard extension used : nameless struct/union /wd4201 # nonstandard extension used : nameless struct/union
/wd4702 # unreachable code (when used with LTO) /wd4702 # unreachable code (when used with LTO)
$<$<CONFIG:Release>:/GS-> # No stack buffer overflow checks
/Gy # Enable function level linking
/GR- # Disable run time type information
) )
if (NOT CXX_CLANG) if (NOT CXX_CLANG)
@@ -101,15 +105,14 @@ if (MSVC AND NOT CXX_CLANG)
add_compile_options(/QIntel-jcc-erratum) add_compile_options(/QIntel-jcc-erratum)
endif() endif()
# /GS- - No stack buffer overflow checks
add_compile_options("$<$<CONFIG:Release>:/GS->")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE) set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE) set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
else() else()
if (NOT MSVC) if (NOT MSVC)
add_compile_options( add_compile_options(
-fwrapv -fwrapv
-fno-rtti # Disable RTTI
-pipe
) )
endif() endif()

View File

@@ -161,7 +161,7 @@ public:
/** /**
* @returns A unique identifier for the Setting's internal data type. * @returns A unique identifier for the Setting's internal data type.
*/ */
[[nodiscard]] virtual std::type_index TypeId() const = 0; [[nodiscard]] virtual std::string_view TypeId() const = 0;
/** /**
* Returns true if the Setting's internal data type is an enum. * Returns true if the Setting's internal data type is an enum.

View File

@@ -220,8 +220,14 @@ public:
* *
* @returns the type_index of the setting's type * @returns the type_index of the setting's type
*/ */
[[nodiscard]] std::type_index TypeId() const override final { [[nodiscard]] std::string_view TypeId() const override final {
return std::type_index(typeid(Type)); if constexpr (std::is_same_v<Type, std::string>) {
return "string";
} else if constexpr (std::is_same_v<Type, bool>) {
return "bool";
} else {
return "other";
}
} }
[[nodiscard]] constexpr u32 EnumIndex() const override final { [[nodiscard]] constexpr u32 EnumIndex() const override final {

View File

@@ -444,9 +444,9 @@ void CmifReplyWrapImpl(HLERequestContext& ctx, T& t, Result (T::*f)(A...)) {
const bool _is_domain = _mgr ? _mgr->IsDomain() : false; const bool _is_domain = _mgr ? _mgr->IsDomain() : false;
ASSERT_MSG(!_is_domain, ASSERT_MSG(!_is_domain,
"Non-domain reply used on domain session\n" "Non-domain reply used on domain session\n"
"Service={} (type={})\nTIPC={} CmdType={} Cmd=0x{:08X}\n" "Service={} (TIPC={} CmdType={} Cmd=0x{:08X}\n"
"HasDomainHeader={} DomainHandlers={}\nDesc={}", "HasDomainHeader={} DomainHandlers={}\nDesc={}",
t.GetServiceName(), typeid(T).name(), ctx.IsTipc(), t.GetServiceName(), ctx.IsTipc(),
static_cast<u32>(ctx.GetCommandType()), static_cast<u32>(ctx.GetCommand()), static_cast<u32>(ctx.GetCommandType()), static_cast<u32>(ctx.GetCommand()),
ctx.HasDomainMessageHeader(), _mgr ? static_cast<u32>(_mgr->DomainHandlerCount()) : 0u, ctx.HasDomainMessageHeader(), _mgr ? static_cast<u32>(_mgr->DomainHandlerCount()) : 0u,
ctx.Description()); ctx.Description());

View File

@@ -515,9 +515,9 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
} }
const bool require_checkbox = const bool require_checkbox =
other_setting != nullptr && other_setting->TypeId() == typeid(bool); other_setting != nullptr && other_setting->ToString() == "bool";
if (other_setting != nullptr && other_setting->TypeId() != typeid(bool)) { if (other_setting != nullptr && other_setting->TypeId() != "bool") {
LOG_WARNING( LOG_WARNING(
Frontend, Frontend,
"Extra setting \"{}\" specified but is not bool, refusing to create checkbox for it.", "Extra setting \"{}\" specified but is not bool, refusing to create checkbox for it.",
@@ -575,12 +575,12 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
QWidget* lhs = QWidget* lhs =
CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch); CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch);
layout->addWidget(lhs, 1); layout->addWidget(lhs, 1);
} else if (setting.TypeId() != typeid(bool)) { } else if (setting.TypeId() != "bool") {
QLabel* qt_label = CreateLabel(label); QLabel* qt_label = CreateLabel(label);
layout->addWidget(qt_label, 1); layout->addWidget(qt_label, 1);
} }
if (setting.TypeId() == typeid(bool)) { if (setting.TypeId() == "bool") {
data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch); data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch);
} else if (setting.IsEnum()) { } else if (setting.IsEnum()) {
if (request == RequestType::RadioGroup) { if (request == RequestType::RadioGroup) {
@@ -629,7 +629,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
} else if (type == typeid(std::string)) { } else if (type == "string") {
switch (request) { switch (request) {
case RequestType::Default: case RequestType::Default:
case RequestType::LineEdit: case RequestType::LineEdit: