Assign value to version where appropriate

This commit is contained in:
Halo-Michael
2022-08-14 02:42:05 +08:00
committed by GitHub
parent c7f261cf86
commit 58d28b4e4d
+2 -1
View File
@@ -98,7 +98,7 @@ static bool g_jitAvailable = false;
static int g_iosVersionMinor;
*/
static int g_iosVersionMajor;
static std::string version = [[[UIDevice currentDevice] systemVersion] UTF8String];
static std::string version;
std::string System_GetProperty(SystemProperty prop) {
switch (prop) {
@@ -259,6 +259,7 @@ int main(int argc, char *argv[])
// So, we'll just resort to a version check.
version = [[[UIDevice currentDevice] systemVersion] UTF8String];
if (2 != sscanf(version.c_str(), "%d", &g_iosVersionMajor)) {
// Just set it to 14.0 if the parsing fails for whatever reason.
g_iosVersionMajor = 14;