MacOS cpu support

This commit is contained in:
Linus Dierheimer
2022-09-04 14:12:04 -07:00
parent ea60fd0a0d
commit cfcc4c8375
4 changed files with 61 additions and 23 deletions
+18
View File
@@ -374,4 +374,22 @@ void ffSettingsGetAppleProperty(const char* propName, FFstrbuf* result)
result->chars[result->length] = '\0';
}
int ffSettingsGetAppleInt(const char* propName, int defaultValue)
{
int result;
size_t neededLength = sizeof(result);
if(sysctlbyname(propName, &result, &neededLength, NULL, 0) != 0)
return defaultValue;
return result;
}
int64_t ffSettingsGetAppleInt64(const char* propName, int64_t defaultValue)
{
int64_t result;
size_t neededLength = sizeof(result);
if(sysctlbyname(propName, &result, &neededLength, NULL, 0) != 0)
return defaultValue;
return result;
}
#endif //__APPLE__
+2
View File
@@ -38,6 +38,8 @@ void ffSettingsGetAndroidProperty(const char* propName, FFstrbuf* result);
#ifdef __APPLE__
void ffSettingsGetAppleProperty(const char* propName, FFstrbuf* result);
int ffSettingsGetAppleInt(const char* propName, int defaultValue);
int64_t ffSettingsGetAppleInt64(const char* propName, int64_t defaultValue);
#endif
#endif