Commit f2f0e2ca authored by Jan Möbius's avatar Jan Möbius

Missing ifdefs for windows

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17836 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d401a0a6
......@@ -152,18 +152,28 @@ void MemInfoPlugin::cpuMemoryInfoUpdate() {
if (mainMemBar_) {
struct sysinfo sys_info;
// Main Memory information
#ifdef WIN32 //Windows
sysinfo(&sys_info);
#elif defined ARCH_DARWIN // Apple
// Unit in bytes ; /1024 -> KB ; /1024 MB
unsigned long totalRamMB = sys_info.totalram / 1024 /1024 * sys_info.mem_unit;
#else // Linux
// Unit in bytes ; /1024 -> KB ; /1024 MB
unsigned long freeRamMB = sys_info.freeram / 1024 / 1024 * sys_info.mem_unit;
mainMemBar_->setRange( 0 , totalRamMB );
mainMemBar_->setValue( totalRamMB-freeRamMB);
struct sysinfo sys_info;
sysinfo(&sys_info);
// Unit in bytes ; /1024 -> KB ; /1024 MB
unsigned long totalRamMB = sys_info.totalram / 1024 /1024 * sys_info.mem_unit;
// Unit in bytes ; /1024 -> KB ; /1024 MB
unsigned long freeRamMB = sys_info.freeram / 1024 / 1024 * sys_info.mem_unit;
mainMemBar_->setRange( 0 , totalRamMB );
mainMemBar_->setValue( totalRamMB-freeRamMB);
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment