Fix compiler error on FreeBSD
This commit is contained in:
parent
fb123f8fd0
commit
abae027538
@ -1,3 +1,8 @@
|
|||||||
|
Version 0.9.7 (unreleased)
|
||||||
|
--------------
|
||||||
|
Compatibility:
|
||||||
|
* Runs on FreeBSD
|
||||||
|
|
||||||
Version 0.9.6
|
Version 0.9.6
|
||||||
---------------
|
---------------
|
||||||
Fixed bugs:
|
Fixed bugs:
|
||||||
|
@ -14,7 +14,7 @@ namespace cpputils{
|
|||||||
if (0 != result) {
|
if (0 != result) {
|
||||||
throw std::runtime_error("sysctlbyname syscall failed");
|
throw std::runtime_error("sysctlbyname syscall failed");
|
||||||
}
|
}
|
||||||
#elif __linux__
|
#elif __linux__ || __FreeBSD__
|
||||||
long numRAMPages = sysconf(_SC_PHYS_PAGES);
|
long numRAMPages = sysconf(_SC_PHYS_PAGES);
|
||||||
long pageSize = sysconf(_SC_PAGESIZE);
|
long pageSize = sysconf(_SC_PAGESIZE);
|
||||||
mem = numRAMPages * pageSize;
|
mem = numRAMPages * pageSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user