[Pixman] [PATCH] Use <sys/mman.h> macros only when they are available

Dmitri Vorobiev dmitri.vorobiev at movial.com
Wed Sep 22 02:34:57 PDT 2010


Not all systems are regular Unices, so let's be careful with the
mmap()-related stuff, which might be unavailable. This patch makes
sure that mmap() and friends is used only when the <sys/mman.h>
header is found.
---
 test/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/test/utils.c b/test/utils.c
index 448c296..2ed5051 100644
--- a/test/utils.c
+++ b/test/utils.c
@@ -218,7 +218,7 @@ typedef struct
     int n_bytes;
 } info_t;
 
-#if defined(HAVE_MPROTECT) && defined(HAVE_GETPAGESIZE)
+#if defined(HAVE_MPROTECT) && defined(HAVE_GETPAGESIZE) && defined(HAVE_SYS_MMAN_H)
 
 /* This is apparently necessary on at least OS X */
 #ifndef MAP_ANONYMOUS
-- 
1.6.3.3



More information about the Pixman mailing list