mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 07:00:20 +02:00
Config: Add check to see if a config option is default
Either the option missing entirely or it's set to the default.
This commit is contained in:
2 files changed
+11
-2
No files matched your search
@@ -99,8 +99,7 @@ static std::optional<uint64_t> RDRANDFallback(uint64_t Reseed) {
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
PrintValue(uint64_t Value) {
|
||||
static void PrintValue(uint64_t Value) {
|
||||
LogMan::Msg::DFmt("Value: 0x{:x}", Value);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,6 +297,16 @@ struct FEX_DEFAULT_VISIBILITY Getter : public Value<typename detail::ConfigOptio
|
||||
using OptionInfo = detail::ConfigOptionInfo<Option>;
|
||||
Getter()
|
||||
: Value<typename OptionInfo::Type> {Option, OptionInfo::Default()} {}
|
||||
|
||||
// Check if the config option is actually the default.
|
||||
bool IsDefault() const {
|
||||
auto Value = FEXCore::Config::GetConv<typename detail::ConfigOptionInfo<Option>::Type>(Option);
|
||||
if (!Value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return *Value == OptionInfo::Default();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user