Add Android basic support

This commit is contained in:
李通洲
2021-10-20 06:04:55 +00:00
parent fd257ddde9
commit 1a5b1428dc
5 changed files with 47 additions and 18 deletions
+9 -6
View File
@@ -63,14 +63,17 @@ void ffPrintCPU(FFinstance* instance)
while(getline(&line, &len, cpuinfo) != -1)
{
ffGetPropValue(line, "model name :", &name);
ffGetPropValue(line, "vendor_id :", &vendor);
ffGetPropValue(line, "cpu cores :", &physicalCoresString);
ffGetPropValue(line, "cpu MHz :", &procGhzString);
//Stop after the first CPU
if(strstr(line, "flags") != NULL)
if(name.length > 0 && (*line == '\0' || *line == '\n'))
break;
(void)(
ffGetPropValue(line, "model name :", &name) ||
ffGetPropValue(line, "vendor_id :", &vendor) ||
ffGetPropValue(line, "cpu cores :", &physicalCoresString) ||
ffGetPropValue(line, "cpu MHz :", &procGhzString) ||
(name.length == 0 && ffGetPropValue(line, "Hardware :", &name)) //For Android devices
);
}
if(line != NULL)