Apparently there exist systems with mprotect(), but not mmap()?
# Functions and headers
-AC_CHECK_FUNCS(mprotect sysconf getpagesize)
+AC_CHECK_FUNCS(mprotect sysconf getpagesize mmap)
AC_CHECK_HEADERS(unistd.h sys/mman.h)
# Compiler flags
/* Unit tests for hb-blob.h */
-#if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT)
+#if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT) && defined(HAVE_MMAP)
# define TEST_MMAP 1
}
+#ifdef TEST_MMAP
static uintptr_t
get_pagesize (void)
{
free_up (fixture);
munmap (fixture->data, get_pagesize ());
}
+#endif
#include <errno.h>
static void
free_func = (hb_destroy_func_t) free_up_free;
break;
-#if TEST_MMAP
+#ifdef TEST_MMAP
case HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE:
{
uintptr_t pagesize = get_pagesize ();