MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / getIdealPlatform

Function getIdealPlatform

launcher/Application.cpp:162–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162QString getIdealPlatform(QString currentPlatform) {
163 auto info = Sys::getKernelInfo();
164 switch(info.kernelType) {
165 case Sys::KernelType::Darwin: {
166 if(info.kernelMajor >= 17) {
167 // macOS 10.13 or newer
168 return "osx64-5.15.2";
169 }
170 else {
171 // macOS 10.12 or older
172 return "osx64";
173 }
174 }
175 case Sys::KernelType::Windows: {
176 // FIXME: 5.15.2 is not stable on Windows, due to a large number of completely unpredictable and hard to reproduce issues
177 break;
178/*
179 if(info.kernelMajor == 6 && info.kernelMinor >= 1) {
180 // Windows 7
181 return "win32-5.15.2";
182 }
183 else if (info.kernelMajor > 6) {
184 // Above Windows 7
185 return "win32-5.15.2";
186 }
187 else {
188 // Below Windows 7
189 return "win32";
190 }
191*/
192 }
193 case Sys::KernelType::Undetermined:
194 case Sys::KernelType::Linux: {
195 break;
196 }
197 }
198 return currentPlatform;
199}
200
201}
202

Callers 1

ApplicationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected