cedric pushed a commit to branch master.

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

commit fa2b1b3d30f8fd54d6b33e2aef3cde848676cb7b
Author: Alex-P. Natsios <drak...@2f30.org>
Date:   Sat Mar 15 19:57:59 2014 +0900

    evas: improve portability for BSD system.
    
    configure: fix prerequisite header issue
    
    Summary:
    in some platforms like openBSD <sys/socket.h> must be included before
    net/if.h
    
    the canonical way to ensure that with autotools is by providing that
    fourth directive.
    
    evas: use MAP_ANON instead of MAP_ANONYMOUS
    
    Stupid unpredictable standards (or not so standard).
    MAP_ANON exists and is defined almost anywhere unlike MAP_ANONYMOUS
    
    Let's use that for portability's sake (they are practically identical
    anyway)
    
    Reviewers: raster, cedric
    
    Reviewed By: cedric
    
    CC: cedric
    
    Differential Revision: https://phab.enlightenment.org/D616
    
    Signed-off-by: Cedric BAIL <cedric.b...@free.fr>
---
 configure.ac                          |  5 +++++
 src/lib/evas/common/evas_image_main.c | 10 ++--------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0b0dac3..3795031 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2059,6 +2059,11 @@ sys/prctl.h \
 sys/resource.h \
 sys/timerfd.h \
 sys/un.h \
+],[],[],
+[
+ #ifdef HAVE_SYS_SOCKET_H
+ # include <sys/socket.h>
+ #endif
 ])
 
 ### Checks for types
diff --git a/src/lib/evas/common/evas_image_main.c 
b/src/lib/evas/common/evas_image_main.c
index e41fab8..5e1c8ae 100644
--- a/src/lib/evas/common/evas_image_main.c
+++ b/src/lib/evas/common/evas_image_main.c
@@ -151,16 +151,10 @@ _evas_common_rgba_image_surface_mmap(unsigned int w, 
unsigned int h, Eina_Bool a
    if (siz < PAGE_SIZE)
      return malloc(siz);
 
-#if defined (__MacOSX__) || (defined (__MACH__) && defined (__APPLE__))
-# ifndef MAP_ANONYMOUS
-#  define MAP_ANONYMOUS MAP_ANON
-# endif
-#endif
-
    if (siz > ((HUGE_PAGE_SIZE * 75) / 100))
-     r = mmap(NULL, siz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | 
MAP_HUGETLB, -1, 0);
+     r = mmap(NULL, siz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | 
MAP_HUGETLB, -1, 0);
    if (r == MAP_FAILED)
-     r = mmap(NULL, siz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 
-1, 0);
+     r = mmap(NULL, siz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 
0);
    if (r == MAP_FAILED)
      r = NULL;
 

-- 


Reply via email to