mingw: move ReadValue instantiations in cpp for compatibility

This commit is contained in:
Craig Carnell 2025-12-08 19:29:59 +00:00
parent fb2a46c4cf
commit e4f6d9bad4
2 changed files with 5 additions and 2 deletions

View File

@ -46,6 +46,11 @@ bool ReadValue(std::string* value, const std::string& subkey, const std::string&
return true;
}
// These explicit instantiations are needed to prevent linker errors when calling
// ReadValue in WinUpdater/Platform.cpp (for u32) and ArmCPUDetect.cpp (for u64)
template bool ReadValue(u32* value, const std::string& subkey, const std::string& name);
template bool ReadValue(u64* value, const std::string& subkey, const std::string& name);
OSVERSIONINFOW GetOSVersion()
{
// PEB may have faked data if the binary is launched with "compatibility mode" enabled.

View File

@ -9,8 +9,6 @@ namespace WindowsRegistry
{
template <typename T>
bool ReadValue(T* value, const std::string& subkey, const std::string& name);
template bool ReadValue(u32* value, const std::string& subkey, const std::string& name);
template bool ReadValue(u64* value, const std::string& subkey, const std::string& name);
template <>
bool ReadValue(std::string* value, const std::string& subkey, const std::string& name);