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:
Ryan Houdek committed 2026-09-20 14:58:48 -07:00
1 parent 48d71752e2
commit 9c871c51c9
2 files changed
+11 -2

No files matched your search

+1 -2
View File
@@ -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);
}
+10
View File
@@ -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();
}
};
/**