summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-08-19 09:55:12 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-08-19 09:55:13 -0400
commit01b987df59154f87a5ed8688c272f0a04bc8c4c9 (patch)
treefb8f8fa042ab81e824db5a4c0fbda1614fb3056d /src/lib
parentce3d1ec7e7c5574651dbf5c278356308528e2ea9 (diff)
make mman.h private
Summary: integrate mman.h to make Evil private to the EFL, as mman.h does not exist on Windows. After a discussion with raster, i include sys/mman.h only on non Windows platform. One issue, though, is that src/modules/emotion/generic/Emotion_Generic_Plugin.h has inlined functions using mmap() Test Plan: compilation on Windows Reviewers: cedric, raster, zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9542
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore/ecore.c4
-rw-r--r--src/lib/ecore_evas/ecore_evas.c4
-rw-r--r--src/lib/eet/eet_cipher.c6
-rw-r--r--src/lib/efreet/efreet_mime.c1
-rw-r--r--src/lib/efreet/efreet_xml.c7
-rw-r--r--src/lib/eina/eina_debug_chunk.c7
-rw-r--r--src/lib/eina/eina_evlog.c8
-rw-r--r--src/lib/eina/eina_safepointer.c7
-rw-r--r--src/lib/eio/eio_private.h1
-rw-r--r--src/lib/elementary/efl_ui_selection_manager.c5
-rw-r--r--src/lib/elput/elput_private.h1
-rw-r--r--src/lib/elua/cache.c1
-rw-r--r--src/lib/eo/eo_ptr_indirection.x7
-rw-r--r--src/lib/evas/canvas/evas_image_private.h3
-rw-r--r--src/lib/evas/common/evas_image_main.c4
-rw-r--r--src/lib/evil/evil_mman.c1
-rw-r--r--src/lib/evil/evil_mman.h (renamed from src/lib/evil/sys/mman.h)28
-rw-r--r--src/lib/evil/evil_private.h1
-rw-r--r--src/lib/evil/meson.build2
19 files changed, 47 insertions, 51 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 7aa987b271..b2ca8aa649 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -15,7 +15,9 @@
15# include <langinfo.h> 15# include <langinfo.h>
16#endif 16#endif
17 17
18#if defined(HAVE_SYS_MMAN_H) || defined(_WIN32) 18#ifdef _WIN32
19# include <evil_private.h> /* mmap */
20#else
19# include <sys/mman.h> 21# include <sys/mman.h>
20#endif 22#endif
21 23
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 18c251f007..9d2d4d10f1 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -14,7 +14,9 @@
14#include <fcntl.h> 14#include <fcntl.h>
15#include <unistd.h> 15#include <unistd.h>
16 16
17#if defined(HAVE_SYS_MMAN_H) || defined(_WIN32) 17#ifdef _WIN32
18# include <evil_private.h> /* mmap */
19#else
18# include <sys/mman.h> 20# include <sys/mman.h>
19#endif 21#endif
20 22
diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c
index 3bdab4c2f1..2314c24e03 100644
--- a/src/lib/eet/eet_cipher.c
+++ b/src/lib/eet/eet_cipher.c
@@ -9,7 +9,11 @@
9#include <unistd.h> 9#include <unistd.h>
10 10
11#ifdef HAVE_SIGNATURE 11#ifdef HAVE_SIGNATURE
12# include <sys/mman.h> 12# ifdef _WIN32
13# include <evil_private.h> /* mmap */
14# else
15# include <sys/mman.h>
16# endif
13# ifdef HAVE_GNUTLS 17# ifdef HAVE_GNUTLS
14# include <gnutls/gnutls.h> 18# include <gnutls/gnutls.h>
15# include <gnutls/x509.h> 19# include <gnutls/x509.h>
diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c
index e4e1ba896f..9eba8c8db9 100644
--- a/src/lib/efreet/efreet_mime.c
+++ b/src/lib/efreet/efreet_mime.c
@@ -6,7 +6,6 @@
6#include <sys/stat.h> 6#include <sys/stat.h>
7#include <fcntl.h> 7#include <fcntl.h>
8#include <unistd.h> 8#include <unistd.h>
9#include <sys/mman.h>
10#include <fnmatch.h> 9#include <fnmatch.h>
11 10
12#include <Ecore.h> 11#include <Ecore.h>
diff --git a/src/lib/efreet/efreet_xml.c b/src/lib/efreet/efreet_xml.c
index 4f4cd2fea8..97a44aa9de 100644
--- a/src/lib/efreet/efreet_xml.c
+++ b/src/lib/efreet/efreet_xml.c
@@ -6,7 +6,12 @@
6#include <sys/stat.h> 6#include <sys/stat.h>
7#include <fcntl.h> 7#include <fcntl.h>
8#include <unistd.h> 8#include <unistd.h>
9#include <sys/mman.h> 9
10#ifdef _WIN32
11# include <evil_private.h> /* mmap */
12#else
13# include <sys/mman.h>
14#endif
10 15
11#include <Ecore_File.h> 16#include <Ecore_File.h>
12 17
diff --git a/src/lib/eina/eina_debug_chunk.c b/src/lib/eina/eina_debug_chunk.c
index 4ee9655140..1c6c028647 100644
--- a/src/lib/eina/eina_debug_chunk.c
+++ b/src/lib/eina/eina_debug_chunk.c
@@ -29,8 +29,13 @@
29# include <memcheck.h> 29# include <memcheck.h>
30#endif 30#endif
31 31
32#ifdef HAVE_MMAP 32#ifdef _WIN32
33# include <evil_private.h> /* mmap */
34#else
33# include <sys/mman.h> 35# include <sys/mman.h>
36#endif
37
38#ifdef HAVE_MMAP
34 39
35// custom memory allocators to avoid malloc/free during backtrace handling 40// custom memory allocators to avoid malloc/free during backtrace handling
36// just in case we're inside some signal handler due to mem corruption and 41// just in case we're inside some signal handler due to mem corruption and
diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c
index 994a370779..4dba784ff1 100644
--- a/src/lib/eina/eina_evlog.c
+++ b/src/lib/eina/eina_evlog.c
@@ -36,9 +36,11 @@
36#include <time.h> 36#include <time.h>
37#include <unistd.h> 37#include <unistd.h>
38 38
39# ifdef HAVE_MMAP 39#ifdef _WIN32
40# include <sys/mman.h> 40# include <evil_private.h> /* mmap */
41# endif 41#else
42# include <sys/mman.h>
43#endif
42 44
43#if __BYTE_ORDER == __LITTLE_ENDIAN 45#if __BYTE_ORDER == __LITTLE_ENDIAN
44#define SWAP_64(x) x 46#define SWAP_64(x) x
diff --git a/src/lib/eina/eina_safepointer.c b/src/lib/eina/eina_safepointer.c
index 8f9d4b62a9..9016aab27a 100644
--- a/src/lib/eina/eina_safepointer.c
+++ b/src/lib/eina/eina_safepointer.c
@@ -10,10 +10,15 @@
10#include <stdint.h> 10#include <stdint.h>
11#include <stdio.h> 11#include <stdio.h>
12#include <stdlib.h> 12#include <stdlib.h>
13#include <sys/mman.h>
14#include <fcntl.h> 13#include <fcntl.h>
15#include <inttypes.h> 14#include <inttypes.h>
16 15
16#ifdef _WIN32
17# include <evil_private.h> /* mmap */
18#else
19# include <sys/mman.h>
20#endif
21
17#include "eina_config.h" 22#include "eina_config.h"
18#include "eina_private.h" 23#include "eina_private.h"
19 24
diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h
index 36d784752d..aa75336124 100644
--- a/src/lib/eio/eio_private.h
+++ b/src/lib/eio/eio_private.h
@@ -23,7 +23,6 @@
23#include <errno.h> 23#include <errno.h>
24#include <sys/types.h> 24#include <sys/types.h>
25#include <sys/stat.h> 25#include <sys/stat.h>
26#include <sys/mman.h>
27#include <unistd.h> 26#include <unistd.h>
28#include <fcntl.h> 27#include <fcntl.h>
29 28
diff --git a/src/lib/elementary/efl_ui_selection_manager.c b/src/lib/elementary/efl_ui_selection_manager.c
index 49b3c5a3b1..e857f4fd98 100644
--- a/src/lib/elementary/efl_ui_selection_manager.c
+++ b/src/lib/elementary/efl_ui_selection_manager.c
@@ -4,7 +4,10 @@
4 4
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_priv.h" 6#include "elm_priv.h"
7#ifdef HAVE_SYS_MMAN_H 7
8#ifdef _WIN32
9# include <evil_private.h> /* mmap */
10#else
8# include <sys/mman.h> 11# include <sys/mman.h>
9#endif 12#endif
10 13
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index 16fe305c5b..744c5a92e3 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -13,7 +13,6 @@
13# include <Elput.h> 13# include <Elput.h>
14 14
15# include <ctype.h> 15# include <ctype.h>
16# include <sys/mman.h>
17# include <fcntl.h> 16# include <fcntl.h>
18# include <unistd.h> 17# include <unistd.h>
19# include <linux/vt.h> 18# include <linux/vt.h>
diff --git a/src/lib/elua/cache.c b/src/lib/elua/cache.c
index 91fcdac658..b18d690569 100644
--- a/src/lib/elua/cache.c
+++ b/src/lib/elua/cache.c
@@ -2,7 +2,6 @@
2 2
3#include <sys/types.h> 3#include <sys/types.h>
4#include <sys/stat.h> 4#include <sys/stat.h>
5#include <sys/mman.h>
6#include <fcntl.h> 5#include <fcntl.h>
7#include <unistd.h> 6#include <unistd.h>
8 7
diff --git a/src/lib/eo/eo_ptr_indirection.x b/src/lib/eo/eo_ptr_indirection.x
index d6affe0cc6..2b3fa5a467 100644
--- a/src/lib/eo/eo_ptr_indirection.x
+++ b/src/lib/eo/eo_ptr_indirection.x
@@ -1,9 +1,12 @@
1#include <assert.h> 1#include <assert.h>
2#ifdef HAVE_MMAP
3#include <sys/types.h> 2#include <sys/types.h>
4#include <sys/stat.h> 3#include <sys/stat.h>
5#include <fcntl.h> 4#include <fcntl.h>
6#include <sys/mman.h> 5
6#ifdef _WIN32
7# include <evil_private.h> /* mmap mprotect */
8#else
9# include <sys/mman.h>
7#endif 10#endif
8 11
9#ifdef HAVE_VALGRIND 12#ifdef HAVE_VALGRIND
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index efd53209c8..2d468184eb 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -12,9 +12,6 @@
12 12
13#include <sys/types.h> 13#include <sys/types.h>
14#include <unistd.h> 14#include <unistd.h>
15#ifdef HAVE_SYS_MMAN_H
16# include <sys/mman.h>
17#endif
18#include <math.h> 15#include <math.h>
19 16
20#include "evas_private.h" 17#include "evas_private.h"
diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c
index e42e05d816..1be23a591e 100644
--- a/src/lib/evas/common/evas_image_main.c
+++ b/src/lib/evas/common/evas_image_main.c
@@ -2,7 +2,9 @@
2# include "config.h" /* so that EAPI in Eet.h is correctly defined */ 2# include "config.h" /* so that EAPI in Eet.h is correctly defined */
3#endif 3#endif
4 4
5#ifdef HAVE_SYS_MMAN_H 5#ifdef _WIN32
6# include <evil_private.h> /* mmap */
7#else
6# include <sys/mman.h> 8# include <sys/mman.h>
7#endif 9#endif
8 10
diff --git a/src/lib/evil/evil_mman.c b/src/lib/evil/evil_mman.c
index b1bcf35bea..dbcfc31901 100644
--- a/src/lib/evil/evil_mman.c
+++ b/src/lib/evil/evil_mman.c
@@ -10,7 +10,6 @@
10 10
11#include <io.h> 11#include <io.h>
12 12
13#include "sys/mman.h"
14#include "evil_private.h" 13#include "evil_private.h"
15 14
16/* 15/*
diff --git a/src/lib/evil/sys/mman.h b/src/lib/evil/evil_mman.h
index 39ebd20638..990d146058 100644
--- a/src/lib/evil/sys/mman.h
+++ b/src/lib/evil/evil_mman.h
@@ -3,25 +3,6 @@
3 3
4#include <sys/types.h> 4#include <sys/types.h>
5 5
6#ifdef EAPI
7# undef EAPI
8#endif
9
10#ifdef EFL_BUILD
11# ifdef DLL_EXPORT
12# define EAPI __declspec(dllexport)
13# else
14# define EAPI
15# endif
16#else
17# define EAPI __declspec(dllimport)
18#endif
19
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25 6
26/** 7/**
27 * @def PROT_NONE 8 * @def PROT_NONE
@@ -177,14 +158,5 @@ EAPI int munmap(void *addr,
177EAPI int mprotect(void *addr, size_t len, int prot); 158EAPI int mprotect(void *addr, size_t len, int prot);
178 159
179 160
180#ifdef __cplusplus
181}
182#endif
183
184
185#undef EAPI
186#define EAPI
187
188
189#endif /* __EVIL_SYS_MMAN_H__ */ 161#endif /* __EVIL_SYS_MMAN_H__ */
190 162
diff --git a/src/lib/evil/evil_private.h b/src/lib/evil/evil_private.h
index a88572bf24..d87ac75423 100644
--- a/src/lib/evil/evil_private.h
+++ b/src/lib/evil/evil_private.h
@@ -49,6 +49,7 @@ extern "C" {
49#include "evil_langinfo.h" 49#include "evil_langinfo.h"
50#include "evil_locale.h" 50#include "evil_locale.h"
51#include "evil_main.h" 51#include "evil_main.h"
52#include "evil_mman.h"
52#include "evil_stdlib.h" 53#include "evil_stdlib.h"
53#include "evil_stdio.h" 54#include "evil_stdio.h"
54#include "evil_string.h" 55#include "evil_string.h"
diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build
index 85978d8e9c..7877c7f914 100644
--- a/src/lib/evil/meson.build
+++ b/src/lib/evil/meson.build
@@ -15,9 +15,7 @@ if target_machine.system() == 'windows'
15 'evil_time.h', 15 'evil_time.h',
16 'evil_unistd.h', 16 'evil_unistd.h',
17 'evil_util.h', 17 'evil_util.h',
18 'dirent.h',
19 ] 18 ]
20 evil_header_sys_src = [join_paths('sys','mman.h')]
21 19
22 evil_src = [ 20 evil_src = [
23 'evil_dlfcn.c', 21 'evil_dlfcn.c',