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.bail@free.fr>
This commit is contained in:
parent
4d8fbd623c
commit
fa2b1b3d30
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue