summaryrefslogtreecommitdiff
path: root/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_RAMSize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_RAMSize.cpp')
-rw-r--r--x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_RAMSize.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_RAMSize.cpp b/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_RAMSize.cpp
new file mode 100644
index 00000000000..7a4209bb140
--- /dev/null
+++ b/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_RAMSize.cpp
@@ -0,0 +1,34 @@
+$NetBSD: patch-Source_WTF_wtf_RAMSize.cpp,v 1.1 2014/12/30 17:23:47 adam Exp $
+
+* Add NetBSD support
+
+--- Source/WTF/wtf/RAMSize.cpp.orig 2013-11-27 01:01:20.000000000 +0000
++++ Source/WTF/wtf/RAMSize.cpp
+@@ -27,7 +27,7 @@
+ #include "RAMSize.h"
+
+ #include "StdLibExtras.h"
+-#if OS(DARWIN)
++#if OS(DARWIN) || OS(NETBSD)
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+@@ -45,13 +45,17 @@ static const size_t ramSizeGuess = 128 *
+
+ static size_t computeRAMSize()
+ {
+-#if OS(DARWIN)
++#if OS(DARWIN) || OS(NETBSD)
+ int mib[2];
+ uint64_t ramSize;
+ size_t length;
+
+ mib[0] = CTL_HW;
++#if OS(DARWIN)
+ mib[1] = HW_MEMSIZE;
++#else
++ mib[1] = HW_PHYSMEM64;
++#endif
+ length = sizeof(int64_t);
+ int sysctlResult = sysctl(mib, 2, &ramSize, &length, 0, 0);
+ if (sysctlResult == -1)