| Server IP : 82.208.35.60 / Your IP : 216.73.216.89 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/astro/stellarsolver/files/ |
Upload File : |
--- stellarsolver/stellarsolver.cpp.orig 2022-07-29 16:11:55 UTC
+++ stellarsolver/stellarsolver.cpp
@@ -7,6 +7,9 @@
*/
#if defined(__APPLE__)
#include <sys/sysctl.h>
+#elif defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
#elif defined(_WIN32)
#include "windows.h"
#else //Linux
@@ -987,8 +990,12 @@ bool StellarSolver::getAvailableRAM(double &availableR
//But from what I read, getting the Available RAM is inconsistent and buggy on many systems.
bool StellarSolver::getAvailableRAM(double &availableRAM, double &totalRAM)
{
-#if defined(Q_OS_OSX)
+#if defined(Q_OS_OSX) || defined(Q_OS_FREEBSD)
+#if defined(Q_OS_FREEBSD)
+ int mib [] = { CTL_HW, HW_REALMEM };
+#else
int mib [] = { CTL_HW, HW_MEMSIZE };
+#endif
size_t length;
length = sizeof(int64_t);
int64_t RAMcheck;