Commit 571b1ca6277dbafc1f340a59ea1c5ee4ddb11c94

Tom Tromey 2016-05-18T10:08:59

Merge pull request #233 from berkerpeksag/mremap Define _GNU_SOURCE on Linux for mremap()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/dlmalloc.c b/src/dlmalloc.c
index 7e4ea83..d63dd36 100644
--- a/src/dlmalloc.c
+++ b/src/dlmalloc.c
@@ -438,6 +438,11 @@ DEFAULT_MMAP_THRESHOLD       default: 256K
 
 */
 
+#if defined __linux__ && !defined _GNU_SOURCE
+/* mremap() on Linux requires this via sys/mman.h */
+#define _GNU_SOURCE 1
+#endif
+
 #ifndef WIN32
 #ifdef _WIN32
 #define WIN32 1