From 8a8d9a4c3ec9708460aa68e9c65ed1efde4735ec Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 20 May 2009 13:26:51 +0200 Subject: Make zeroptr.h work on mingw. --- tests/zerosize-ptr.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/zerosize-ptr.h') diff --git a/tests/zerosize-ptr.h b/tests/zerosize-ptr.h index fa00aeeee5..9918ac7210 100644 --- a/tests/zerosize-ptr.h +++ b/tests/zerosize-ptr.h @@ -20,7 +20,11 @@ #include -#if HAVE_MPROTECT +/* Test whether mmap() and mprotect() are available. + We don't use HAVE_MMAP, because AC_FUNC_MMAP would not define it on HP-UX. + HAVE_MPROTECT is not enough, because mingw does not have mmap() but has an + mprotect() function in libgcc.a. */ +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT # include # include # include @@ -39,7 +43,7 @@ zerosize_ptr (void) { /* Use mmap and mprotect when they exist. Don't test HAVE_MMAP, because it is not defined on HP-UX 11 (since it does not support MAP_FIXED). */ -#if HAVE_MPROTECT +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT # if HAVE_MAP_ANONYMOUS const int flags = MAP_ANONYMOUS | MAP_PRIVATE; const int fd = -1; -- cgit v1.2.1