summaryrefslogtreecommitdiff
path: root/graphics/libecwj2/files/patch-Source-C-NCSUtil-malloc.c
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org>2010-08-03 10:26:57 +0000
committerSergey A. Osokin <osa@FreeBSD.org>2010-08-03 10:26:57 +0000
commit214b06a42c3d7c239b4a04ea91486973892707ba (patch)
treeafa55c4a92e026d48ee93107fc05d648ce9e4b8e /graphics/libecwj2/files/patch-Source-C-NCSUtil-malloc.c
parentAllows building executables simply from sbcl. (diff)
Add graphics/libecwj2 that implements support for the JPEG2000 and
ECW image formats. Submitted by: glebius
Notes
Notes: svn path=/head/; revision=258676
Diffstat (limited to 'graphics/libecwj2/files/patch-Source-C-NCSUtil-malloc.c')
-rw-r--r--graphics/libecwj2/files/patch-Source-C-NCSUtil-malloc.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/graphics/libecwj2/files/patch-Source-C-NCSUtil-malloc.c b/graphics/libecwj2/files/patch-Source-C-NCSUtil-malloc.c
new file mode 100644
index 000000000000..d2f40f227123
--- /dev/null
+++ b/graphics/libecwj2/files/patch-Source-C-NCSUtil-malloc.c
@@ -0,0 +1,35 @@
+--- Source/C/NCSUtil/malloc.c.orig 2009-04-05 22:40:20.000000000 +0400
++++ Source/C/NCSUtil/malloc.c 2009-04-05 22:44:30.000000000 +0400
+@@ -70,6 +70,10 @@
+
+ #endif
+
++#ifdef FREEBSD
++#include <sys/sysctl.h>
++#endif
++
+ void NCSMallocInit(void)
+ {
+ #ifdef NOTDEF
+@@ -430,7 +434,21 @@
+ return((INT32)nTotalRam);
+
+ #else /* PALM */
++
++#ifdef FREEBSD
++ int mib[2], physmem;
++ size_t len;
++
++ mib[0] = CTL_HW;
++ mib[1] = HW_PHYSMEM;
++ len = sizeof(physmem);
++ sysctl(mib, 2, &physmem, &len, NULL, 0);
++
++ return (physmem);
++
++#else /* FREEBSD */
+ #error - NCSPhysicalMemorySize()
++#endif /* FREEBSD */
+ #endif /* PALM */
+ #endif /* SOLARIS */
+ #endif /* IRIX */