2019-06-07 10:03:08 +08:00
|
|
|
diff --git a/src/util.cpp b/src/util.cpp
|
2021-07-23 06:31:44 +08:00
|
|
|
index 3670a019..fb5d884f 100644
|
2019-06-07 10:03:08 +08:00
|
|
|
--- a/src/util.cpp
|
|
|
|
+++ b/src/util.cpp
|
2021-07-23 06:31:44 +08:00
|
|
|
@@ -255,9 +255,15 @@ bool ReadEnvironmentVariable(const char *var_name, std::string *_value) {
|
2020-04-17 04:30:13 +08:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
__pragma(warning(disable : 4996)); // _CRT_SECURE_NO_WARNINGS
|
|
|
|
#endif
|
|
|
|
+#if _WIN32_WINNT < 0x0A00
|
2019-06-07 10:03:08 +08:00
|
|
|
auto env_str = std::getenv(var_name);
|
|
|
|
if (!env_str) return false;
|
|
|
|
if (_value) *_value = std::string(env_str);
|
|
|
|
+#else
|
|
|
|
+ //There is no support for environment variables in UWP
|
|
|
|
+ var_name; // Do nothing
|
|
|
|
+ *_value = std::string("");
|
|
|
|
+#endif
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|