diff --git a/Installer/Installer.nsi b/Installer/Installer.nsi index f52497f8ce..95c8224c86 100644 --- a/Installer/Installer.nsi +++ b/Installer/Installer.nsi @@ -137,7 +137,7 @@ Function .onInit !insertmacro MULTIUSER_INIT ; Keep in sync with build_info.txt - !define MIN_WIN10_VERSION 1703 + !define MIN_WIN10_VERSION 1903 ${IfNot} ${AtLeastwin10} ${OrIfNot} ${AtLeastWaaS} ${MIN_WIN10_VERSION} MessageBox MB_OK "At least Windows 10 version ${MIN_WIN10_VERSION} is required." diff --git a/Readme.md b/Readme.md index f08b0be443..5a4e5363b3 100644 --- a/Readme.md +++ b/Readme.md @@ -13,7 +13,7 @@ Please read the [FAQ](https://dolphin-emu.org/docs/faq/) before using Dolphin. ### Desktop * OS - * Windows (10 1703 or higher). + * Windows (10 1903 or higher). * Linux. * macOS (10.15 Catalina or higher). * Unix-like systems other than Linux are not officially supported but might work. diff --git a/Source/Core/Common/Timer.cpp b/Source/Core/Common/Timer.cpp index 91381eebd3..fb81164390 100644 --- a/Source/Core/Common/Timer.cpp +++ b/Source/Core/Common/Timer.cpp @@ -7,7 +7,6 @@ #ifdef _WIN32 #include -#include #include #else #include @@ -68,10 +67,12 @@ u64 Timer::ElapsedMs() const u64 Timer::GetLocalTimeSinceJan1970() { - // TODO Would really, really like to use std::chrono here, but Windows did not support - // std::chrono::current_zone() until 19H1, and other compilers don't even provide support for - // timezone-related parts of chrono. Someday! - // see https://bugs.dolphin-emu.org/issues/13007#note-4 +#ifdef _MSC_VER + std::chrono::zoned_seconds seconds( + std::chrono::current_zone(), + std::chrono::time_point_cast(std::chrono::system_clock::now())); + return seconds.get_local_time().time_since_epoch().count(); +#else time_t sysTime, tzDiff, tzDST; time(&sysTime); tm* gmTime = localtime(&sysTime); @@ -87,6 +88,7 @@ u64 Timer::GetLocalTimeSinceJan1970() tzDiff = sysTime - mktime(gmTime); return static_cast(sysTime + tzDiff + tzDST); +#endif } void Timer::IncreaseResolution() diff --git a/Source/Core/Common/build_info.txt.in b/Source/Core/Common/build_info.txt.in index 5d658d95e6..03b52f60f4 100644 --- a/Source/Core/Common/build_info.txt.in +++ b/Source/Core/Common/build_info.txt.in @@ -1,6 +1,6 @@ // Indicate the minimum OS version required for the binary to run properly. // Updater will fail the update if the user does not meet this requirement. -OSMinimumVersionWin10=10.0.15063.0 +OSMinimumVersionWin10=10.0.18362.0 OSMinimumVersionWin11=10.0.22000.0 // This is the runtime which was compiled against - providing a way for Updater to detect if update diff --git a/Source/Core/Core/Config/DefaultLocale.cpp b/Source/Core/Core/Config/DefaultLocale.cpp index 019bebf4fb..fe1f345554 100644 --- a/Source/Core/Core/Config/DefaultLocale.cpp +++ b/Source/Core/Core/Config/DefaultLocale.cpp @@ -90,13 +90,15 @@ static std::string ComputeDefaultCountryCode() #ifdef _WIN32 // Windows codepath: Check the regional information. // More likely to match the user's physical location than locales are. - // TODO: Can we use GetUserDefaultGeoName? (It was added in a Windows 10 update) - GEOID geo = GetUserGeoID(GEOCLASS_NATION); - const int buffer_size = GetGeoInfoW(geo, GEO_ISO2, nullptr, 0, 0); - std::vector buffer(buffer_size); - const int result = GetGeoInfoW(geo, GEO_ISO2, buffer.data(), buffer_size, 0); - if (result != 0) - return TStrToUTF8(buffer.data()); + const int buffer_size = GetUserDefaultGeoName(nullptr, 0); + if (buffer_size == 3) + { + std::wstring buffer(buffer_size, L'\0'); + const int result = GetUserDefaultGeoName(buffer.data(), buffer_size); + buffer.resize(2); + if (result > 0) + return WStringToUTF8(buffer); + } #endif // Generic codepath: Check the locales.