q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=78acf69e2037f572265859dcef0c7fef60792aa5

commit 78acf69e2037f572265859dcef0c7fef60792aa5
Author: Daniel Kolesa <[email protected]>
Date:   Thu Aug 21 11:53:41 2014 +0100

    eo, autotools: check for mmap feature rather than OS (mmap is POSIX)
---
 configure.ac                    | 1 +
 src/lib/eo/eo.c                 | 6 +++---
 src/lib/eo/eo_ptr_indirection.x | 8 ++++----
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 61f5479..8f639e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -585,6 +585,7 @@ pause \
 ])
 
 AC_FUNC_ALLOCA
+AC_FUNC_MMAP
 
 EFL_CHECK_FUNCS([EFLALL], [fnmatch gettimeofday dirfd fcntl])
 
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 187b240..bb54d1c 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -289,7 +289,7 @@ typedef struct _Eo_Call_Stack {
 static void *
 _eo_call_stack_mem_alloc(size_t maxsize)
 {
-#if defined (__linux__) || defined (__MacOSX__)
+#ifdef HAVE_MMAP
    // allocate eo call stack via mmped anon segment if on linux - more
    // secure and safe. also gives page aligned memory allowing madvise
    void *ptr;
@@ -310,7 +310,7 @@ _eo_call_stack_mem_alloc(size_t maxsize)
 #endif
 }
 
-#if defined (__linux__) || defined (__MacOSX__)
+#ifdef HAVE_MMAP
 static void
 _eo_call_stack_mem_resize(void **ptr EINA_UNUSED, size_t newsize, size_t 
maxsize)
 {
@@ -331,7 +331,7 @@ _eo_call_stack_mem_resize(void **ptr EINA_UNUSED, size_t 
newsize EINA_UNUSED, si
 #endif
 }
 
-#if defined (__linux__) || defined (__MacOSX__)
+#ifdef HAVE_MMAP
 static void
 _eo_call_stack_mem_free(void *ptr, size_t maxsize)
 {
diff --git a/src/lib/eo/eo_ptr_indirection.x b/src/lib/eo/eo_ptr_indirection.x
index 5bba62d..aa5ea67 100644
--- a/src/lib/eo/eo_ptr_indirection.x
+++ b/src/lib/eo/eo_ptr_indirection.x
@@ -1,5 +1,5 @@
 #include <assert.h>
-#if defined (__linux__) || defined (__MacOSX__)
+#ifdef HAVE_MMAP
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -119,7 +119,7 @@ typedef struct _Mem_Header
 static void *
 _eo_id_mem_alloc(size_t size)
 {
-#if defined (__linux__) || defined (__MacOSX__)
+#ifdef HAVE_MMAP
    void *ptr;
    Mem_Header *hdr;
    size_t newsize;
@@ -154,7 +154,7 @@ _eo_id_mem_calloc(size_t num, size_t size)
 static void
 _eo_id_mem_free(void *ptr)
 {
-#if defined (__linux__) || defined (__MacOSX__)
+#ifdef HAVE_MMAP
    Mem_Header *hdr;
    if (!ptr) return;
    hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);
@@ -173,7 +173,7 @@ _eo_id_mem_free(void *ptr)
 static void
 _eo_id_mem_protect(void *ptr, Eina_Bool may_not_write)
 {
-# if defined (__linux__) || defined (__MacOSX__)
+# ifdef HAVE_MMAP
    Mem_Header *hdr;
    if (!ptr) return;
    hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);

-- 


Reply via email to