mirror of
https://github.com/TheWhiteDog9487/lag2cn.git
synced 2026-08-11 23:01:29 +08:00
抛弃对Windows的探测,直接丢进Unsupported里面
This commit is contained in:
+1
-8
@@ -27,7 +27,6 @@ LC_ALL="zh_CN.UTF-8"
|
|||||||
|
|
||||||
enum class System{
|
enum class System{
|
||||||
WSL,
|
WSL,
|
||||||
Windows,
|
|
||||||
Linux,
|
Linux,
|
||||||
Unsupported };
|
Unsupported };
|
||||||
enum class User{
|
enum class User{
|
||||||
@@ -58,9 +57,6 @@ auto GetCurrentSystemType(){
|
|||||||
if (getenv("WSL_INTEROP") != nullptr){
|
if (getenv("WSL_INTEROP") != nullptr){
|
||||||
return System::WSL; }
|
return System::WSL; }
|
||||||
#pragma warning(suppress : 4996)
|
#pragma warning(suppress : 4996)
|
||||||
if (getenv("OS") != nullptr){
|
|
||||||
return System::Windows;}
|
|
||||||
#pragma warning(suppress : 4996)
|
|
||||||
else if (getenv("HOME") != nullptr){
|
else if (getenv("HOME") != nullptr){
|
||||||
return System::Linux;}
|
return System::Linux;}
|
||||||
else{
|
else{
|
||||||
@@ -158,10 +154,7 @@ auto Debian(){
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
auto OSType = GetCurrentSystemType();
|
auto OSType = GetCurrentSystemType();
|
||||||
if (OSType == System::Windows){
|
if (OSType == System::WSL) {
|
||||||
cout << "Windows请在“设置”应用中调整语言(❁´◡`❁)。" << endl;
|
|
||||||
throw runtime_error("不支持的操作系统"); }
|
|
||||||
else if (OSType == System::WSL) {
|
|
||||||
auto OS = GetCurrentSystem();
|
auto OS = GetCurrentSystem();
|
||||||
cout << "检测到您使用的系统为:" << OS << endl;
|
cout << "检测到您使用的系统为:" << OS << endl;
|
||||||
cout << "并且该系统工作于WSL环境" << endl;
|
cout << "并且该系统工作于WSL环境" << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user