From: Behdad Esfahbod Date: Tue, 17 May 2011 19:05:34 +0000 (-0400) Subject: Check for mmap() X-Git-Tag: submit/2.0alpha-wayland/20121130.004132~9^2~159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5be7d047f6bf54cc577e311b5426c463d2b9b131;p=profile%2Fivi%2Forg.tizen.video-player.git Check for mmap() Apparently there exist systems with mprotect(), but not mmap()? --- diff --git a/configure.ac b/configure.ac index 96dbca5..ba3290a 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ AC_SUBST(HB_VERSION) # 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 diff --git a/test/test-blob.c b/test/test-blob.c index f3f7a86..5fcb208 100644 --- a/test/test-blob.c +++ b/test/test-blob.c @@ -28,7 +28,7 @@ /* 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 @@ -109,6 +109,7 @@ free_up_free (fixture_t *fixture) } +#ifdef TEST_MMAP static uintptr_t get_pagesize (void) { @@ -133,6 +134,7 @@ free_up_munmap (fixture_t *fixture) free_up (fixture); munmap (fixture->data, get_pagesize ()); } +#endif #include static void @@ -164,7 +166,7 @@ fixture_init (fixture_t *fixture, gconstpointer user_data) 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 ();