summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2025-03-25 18:30:15 -0400
committerGitHub <noreply@github.com>2025-03-25 18:30:15 -0400
commit1981f222284448cc8a69d970e1f8569dacec684e (patch)
treef30ee8c70fd001f7bb5c76fe80c41ff52532753c /Source/Core
parenteb84b0fb9b3cd21400987a1c10c4a38d4861b9a9 (diff)
parentc1dea828ab311ac68b85136a97695f447b3b2574 (diff)
Merge pull request #13433 from iwubcode/update_min_win10
Update our minimum windows 10 version to 1903 and reinstate code that depends on it
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Timer.cpp12
-rw-r--r--Source/Core/Common/build_info.txt.in2
-rw-r--r--Source/Core/Core/Config/DefaultLocale.cpp16
3 files changed, 17 insertions, 13 deletions
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 <Windows.h>
-#include <ctime>
#include <timeapi.h>
#else
#include <sys/time.h>
@@ -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::seconds>(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<u64>(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<wchar_t> 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.