mirror of https://github.com/odrling/Aegisub
Fill in most of the hardware fields for MAC.
Originally committed to SVN as r3600.
This commit is contained in:
parent
b7caa012da
commit
84e17451f9
|
@ -35,12 +35,15 @@ extern "C" {
|
||||||
wxString PlatformUnixOSX::CPUId() {
|
wxString PlatformUnixOSX::CPUId() {
|
||||||
char id[300];
|
char id[300];
|
||||||
size_t len = sizeof(id);
|
size_t len = sizeof(id);
|
||||||
sysctlbyname("hw.model", &id, &len, NULL, 0);
|
sysctlbyname("machdep.cpu.brand_string", &id, &len, NULL, 0);
|
||||||
return wxString::Format("%s", id);
|
return wxString::Format("%s", id);
|
||||||
};
|
};
|
||||||
|
|
||||||
wxString PlatformUnixOSX::CPUSpeed() {
|
wxString PlatformUnixOSX::CPUSpeed() {
|
||||||
return "";
|
uint64_t speed;
|
||||||
|
size_t len = sizeof(speed);
|
||||||
|
sysctlbyname("hw.cpufrequency_max", &speed, &len, NULL, 0);
|
||||||
|
return wxString::Format("%d", speed / (1000*1000));
|
||||||
};
|
};
|
||||||
|
|
||||||
wxString PlatformUnixOSX::CPUCores() {
|
wxString PlatformUnixOSX::CPUCores() {
|
||||||
|
@ -55,19 +58,25 @@ wxString PlatformUnixOSX::CPUCount() {
|
||||||
};
|
};
|
||||||
|
|
||||||
wxString PlatformUnixOSX::CPUFeatures() {
|
wxString PlatformUnixOSX::CPUFeatures() {
|
||||||
return "";
|
char feat[300];
|
||||||
|
size_t len = sizeof(feat);
|
||||||
|
sysctlbyname("machdep.cpu.features", &feat, &len, NULL, 0);
|
||||||
|
return wxString::Format("%s", feat);
|
||||||
};
|
};
|
||||||
|
|
||||||
wxString PlatformUnixOSX::CPUFeatures2() {
|
wxString PlatformUnixOSX::CPUFeatures2() {
|
||||||
|
char feat[128];
|
||||||
|
size_t len = sizeof(feat);
|
||||||
|
sysctlbyname("machdep.cpu.extfeatures", &feat, &len, NULL, 0);
|
||||||
|
return wxString::Format("%s", feat);
|
||||||
return "";
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
wxString PlatformUnixOSX::Memory() {
|
wxString PlatformUnixOSX::Memory() {
|
||||||
uint64_t memory;
|
uint64_t memory;
|
||||||
size_t len = sizeof(memory);
|
size_t len = sizeof(memory);
|
||||||
sysctlbyname("hw.physmem", &memory, &len, NULL, 0);
|
sysctlbyname("hw.memsize", &memory, &len, NULL, 0);
|
||||||
return wxString::Format("%d", memory);
|
return wxString::Format("%llu", memory);
|
||||||
return "";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
wxString PlatformUnixOSX::UnixLibraries() {
|
wxString PlatformUnixOSX::UnixLibraries() {
|
||||||
|
@ -83,6 +92,9 @@ wxString PlatformUnixOSX::QuickTimeExt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString PlatformUnixOSX::HardwareModel() {
|
wxString PlatformUnixOSX::HardwareModel() {
|
||||||
return "";
|
char model[300];
|
||||||
|
size_t len = sizeof(model);
|
||||||
|
sysctlbyname("hw.model", &model, &len, NULL, 0);
|
||||||
|
return wxString::Format("%s", model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue