Fix osx reporter compilation. Patch by torque. Closes #1366.
Originally committed to SVN as r5899.
This commit is contained in:
parent
908d1cadae
commit
2f85e5b398
2 changed files with 12 additions and 13 deletions
|
@ -36,47 +36,46 @@ std::string PlatformUnixOSX::CPUId() {
|
||||||
char id[300];
|
char id[300];
|
||||||
size_t len = sizeof(id);
|
size_t len = sizeof(id);
|
||||||
sysctlbyname("machdep.cpu.brand_string", &id, &len, NULL, 0);
|
sysctlbyname("machdep.cpu.brand_string", &id, &len, NULL, 0);
|
||||||
return wxString::Format("%s", id);
|
return wxString::Format("%s", id).ToStdString();
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string PlatformUnixOSX::CPUSpeed() {
|
std::string PlatformUnixOSX::CPUSpeed() {
|
||||||
uint64_t speed;
|
uint64_t speed;
|
||||||
size_t len = sizeof(speed);
|
size_t len = sizeof(speed);
|
||||||
sysctlbyname("hw.cpufrequency_max", &speed, &len, NULL, 0);
|
sysctlbyname("hw.cpufrequency_max", &speed, &len, NULL, 0);
|
||||||
return wxString::Format("%d", speed / (1000*1000));
|
return wxString::Format("%d", speed / (1000*1000)).ToStdString();
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string PlatformUnixOSX::CPUCores() {
|
int PlatformUnixOSX::CPUCores() {
|
||||||
return "";
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string PlatformUnixOSX::CPUCount() {
|
int PlatformUnixOSX::CPUCount() {
|
||||||
int proc;
|
int proc;
|
||||||
size_t len = sizeof(proc);
|
size_t len = sizeof(proc);
|
||||||
sysctlbyname("hw.ncpu", &proc, &len, NULL, 0);
|
sysctlbyname("hw.ncpu", &proc, &len, NULL, 0);
|
||||||
return wxString::Format("%d", proc);
|
return proc;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string PlatformUnixOSX::CPUFeatures() {
|
std::string PlatformUnixOSX::CPUFeatures() {
|
||||||
char feat[300];
|
char feat[300];
|
||||||
size_t len = sizeof(feat);
|
size_t len = sizeof(feat);
|
||||||
sysctlbyname("machdep.cpu.features", &feat, &len, NULL, 0);
|
sysctlbyname("machdep.cpu.features", &feat, &len, NULL, 0);
|
||||||
return wxString::Format("%s", feat);
|
return wxString::Format("%s", feat).ToStdString();
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string PlatformUnixOSX::CPUFeatures2() {
|
std::string PlatformUnixOSX::CPUFeatures2() {
|
||||||
char feat[128];
|
char feat[128];
|
||||||
size_t len = sizeof(feat);
|
size_t len = sizeof(feat);
|
||||||
sysctlbyname("machdep.cpu.extfeatures", &feat, &len, NULL, 0);
|
sysctlbyname("machdep.cpu.extfeatures", &feat, &len, NULL, 0);
|
||||||
return wxString::Format("%s", feat);
|
return wxString::Format("%s", feat).ToStdString();
|
||||||
return "";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string PlatformUnixOSX::Memory() {
|
uint64_t PlatformUnixOSX::Memory() {
|
||||||
uint64_t memory;
|
uint64_t memory;
|
||||||
size_t len = sizeof(memory);
|
size_t len = sizeof(memory);
|
||||||
sysctlbyname("hw.memsize", &memory, &len, NULL, 0);
|
sysctlbyname("hw.memsize", &memory, &len, NULL, 0);
|
||||||
return wxString::Format("%llu", memory);
|
return memory;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string PlatformUnixOSX::UnixLibraries() {
|
std::string PlatformUnixOSX::UnixLibraries() {
|
||||||
|
@ -95,6 +94,6 @@ std::string PlatformUnixOSX::HardwareModel() {
|
||||||
char model[300];
|
char model[300];
|
||||||
size_t len = sizeof(model);
|
size_t len = sizeof(model);
|
||||||
sysctlbyname("hw.model", &model, &len, NULL, 0);
|
sysctlbyname("hw.model", &model, &len, NULL, 0);
|
||||||
return wxString::Format("%s", model);
|
return wxString::Format("%s", model).ToStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ std::string config_path() {
|
||||||
wxStandardPathsBase &paths = wxStandardPaths::Get();
|
wxStandardPathsBase &paths = wxStandardPaths::Get();
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
return std::string((wxString::Format("%s-%s/", paths.GetUserDataDir(), _T(AEGISUB_VERSION_DATA)));
|
return std::string((wxString::Format("%s-%s/", paths.GetUserDataDir(), _T(AEGISUB_VERSION_DATA))));
|
||||||
#elif defined(__UNIX__)
|
#elif defined(__UNIX__)
|
||||||
return std::string(wxString::Format("%s/.aegisub-%s/", paths.GetUserConfigDir(), _T(AEGISUB_VERSION_DATA)));
|
return std::string(wxString::Format("%s/.aegisub-%s/", paths.GetUserConfigDir(), _T(AEGISUB_VERSION_DATA)));
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue