summaryrefslogtreecommitdiff
path: root/www/elinks/patches/patch-ae
blob: 76df91e9237f0fc07cf00f5fa530b048bedd8686 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$NetBSD: patch-ae,v 1.2 2008/11/06 08:33:31 bjs Exp $

--- src/util/memory.c.orig	2008-09-21 04:45:22.000000000 -0400
+++ src/util/memory.c
@@ -21,6 +21,12 @@
 #include "util/error.h"
 #include "util/memory.h"
 
+#if defined(__NetBSD__)
+# define MREMAP(p, oldsz, newsz, f)   	mremap(p, oldsz, p, newsz, f)
+# define MREMAP_MAYMOVE	0
+#else
+# define MREMAP(p, oldsz, newsz, f)	mremap(p, oldsz, newsz, f)
+#endif
 
 #if !defined(DEBUG_MEMLEAK) && !defined(CONFIG_FASTMEM)
 
@@ -181,7 +187,7 @@ mem_mmap_realloc(void *p, size_t old_siz
 
 	if (new_size) {
 #ifdef HAVE_MREMAP
-		void *p2 = mremap(p, round_size(old_size), round_size(new_size), MREMAP_MAYMOVE);
+		void *p2 = MREMAP(p, round_size(old_size), round_size(new_size), MREMAP_MAYMOVE);
 
 		if (p2 != MAP_FAILED)
 			return p2;