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
devs/bu5hm4n/arm-test
Vincent Torri 4 years ago committed by Mike Blumenkrantz
parent ce3d1ec7e7
commit 01b987df59
  1. 2
      header_checks/meson.build
  2. 6
      src/bin/edje/edje_cc_handlers.c
  3. 1
      src/bin/elementary/elm_prefs_cc_handlers.c
  4. 1
      src/generic/emotion/vlc/emotion_generic_vlc.c
  5. 9
      src/generic/evas/common/shmfile.c
  6. 7
      src/generic/evas/gst/main.c
  7. 1
      src/generic/evas/gst/main_0_10.c
  8. 9
      src/generic/evas/pdf/main.cpp
  9. 5
      src/generic/evas/ps/main.c
  10. 13
      src/generic/evas/raw/main.c
  11. 4
      src/generic/evas/rsvg/main.c
  12. 1
      src/generic/evas/xcf/common.h
  13. 4
      src/generic/evas/xcf/main.c
  14. 4
      src/lib/ecore/ecore.c
  15. 4
      src/lib/ecore_evas/ecore_evas.c
  16. 6
      src/lib/eet/eet_cipher.c
  17. 1
      src/lib/efreet/efreet_mime.c
  18. 7
      src/lib/efreet/efreet_xml.c
  19. 7
      src/lib/eina/eina_debug_chunk.c
  20. 8
      src/lib/eina/eina_evlog.c
  21. 7
      src/lib/eina/eina_safepointer.c
  22. 1
      src/lib/eio/eio_private.h
  23. 5
      src/lib/elementary/efl_ui_selection_manager.c
  24. 1
      src/lib/elput/elput_private.h
  25. 1
      src/lib/elua/cache.c
  26. 7
      src/lib/eo/eo_ptr_indirection.x
  27. 3
      src/lib/evas/canvas/evas_image_private.h
  28. 4
      src/lib/evas/common/evas_image_main.c
  29. 1
      src/lib/evil/evil_mman.c
  30. 28
      src/lib/evil/evil_mman.h
  31. 1
      src/lib/evil/evil_private.h
  32. 2
      src/lib/evil/meson.build
  33. 6
      src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h
  34. 8
      src/modules/evas/engines/software_generic/evas_native_dmabuf.c
  35. 7
      src/modules/evas/image_loaders/generic/evas_image_load_generic.c
  36. 1
      src/tests/efreet/efreet_icon_cache_dump.c

@ -248,8 +248,6 @@ config_h.set('SIZEOF_INT', cc.sizeof('int'))
config_h.set('SIZEOF_LONG', cc.sizeof('long'))
if sys_windows == true
config_h.set('HAVE_DLSYM', '1')
config_h.set('HAVE_NOTIFY_WIN32', '1')
config_h.set10('HAVE_WINDOWS_H', true)
config_h.set10('HAVE_DDRAW_H', true)
endif

@ -34,9 +34,13 @@
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <ctype.h>
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#include "edje_cc.h"

@ -32,7 +32,6 @@
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include "elm_prefs_cc.h"

@ -8,7 +8,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>

@ -11,16 +11,19 @@
# include <netinet/in.h>
#endif
#include <time.h>
#ifdef HAVE_SHM_OPEN
# include <sys/mman.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <zlib.h>
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# undef WIN32_LEAN_AND_MEAN
#else
# include <sys/mman.h>
#endif
#ifdef __cplusplus

@ -2,9 +2,6 @@
# include <config.h>
#endif
#ifdef HAVE_SHM_OPEN
# include <sys/mman.h>
#endif
#include <fcntl.h>
#include <unistd.h>
@ -272,7 +269,11 @@ main(int argc, char **argv)
if (!head_only)
{
#ifdef _WIN32
if (shm_fd)
#else
if (shm_fd >= 0)
#endif
{
printf("shmfile %s\n", shmfile);
}

@ -2,7 +2,6 @@
# include <config.h>
#endif
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>

@ -2,9 +2,6 @@
# include <config.h>
#endif
#ifdef HAVE_SHM_OPEN
# include <sys/mman.h>
#endif
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
@ -317,11 +314,13 @@ main(int argc, char **argv)
if (!head_only)
{
#ifdef HAVE_SHM_OPEN
#ifdef _WIN32
if (shm_fd)
#else
if (shm_fd >= 0)
#endif
printf("shmfile %s\n", shmfile);
else
#endif
{
// could also to "tmpfile %s\n" like shmfile but just
// a mmaped tmp file on the system

@ -2,7 +2,6 @@
# include <config.h>
#endif
#include <sys/mman.h>
#include <fcntl.h>
#include <libspectre/spectre.h>
@ -270,7 +269,11 @@ main(int argc, char **argv)
if (!head_only)
{
#ifdef _WIN32
if (shm_fd) printf("shmfile %s\n", shmfile);
#else
if (shm_fd >= 0) printf("shmfile %s\n", shmfile);
#endif
else
{
// could also to "tmpfile %s\n" like shmfile but just

@ -3,7 +3,6 @@
#endif
#include <fcntl.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@ -15,6 +14,12 @@
# include <unistd.h>
#endif
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#include <Eina.h>
@ -204,7 +209,7 @@ int main(int argc, char **argv)
}
timeout_init(4);
if (!_raw_init(file)) return -1;
if (head_only != 0)
{
@ -221,7 +226,11 @@ int main(int argc, char **argv)
{
printf("size %d %d\n", width, height);
printf("alpha 1\n");
#ifdef _WIN32
if (shm_fd) printf("shmfile %s\n", shmfile);
#else
if (shm_fd >= 0) printf("shmfile %s\n", shmfile);
#endif
else
{
printf("data\n");

@ -214,7 +214,11 @@ int main(int argc, char **argv)
{
printf("size %d %d\n", width, height);
printf("alpha 1\n");
#ifdef _WIN32
if (shm_fd) printf("shmfile %s\n", shmfile);
#else
if (shm_fd >= 0) printf("shmfile %s\n", shmfile);
#endif
else
{
printf("data\n");

@ -14,7 +14,6 @@
# include <netinet/in.h>
#endif
#include <time.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

@ -1714,7 +1714,11 @@ main(int argc, char **argv)
printf("alpha 1\n");
if (!head_only)
{
#ifdef _WIN32
if (shm_fd) printf("shmfile %s\n", shmfile);
#else
if (shm_fd >= 0) printf("shmfile %s\n", shmfile);
#endif
else
{
// could also to "tmpfile %s\n" like shmfile but just

@ -15,7 +15,9 @@
# include <langinfo.h>
#endif
#if defined(HAVE_SYS_MMAN_H) || defined(_WIN32)
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif

@ -14,7 +14,9 @@
#include <fcntl.h>
#include <unistd.h>
#if defined(HAVE_SYS_MMAN_H) || defined(_WIN32)
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif

@ -9,7 +9,11 @@
#include <unistd.h>
#ifdef HAVE_SIGNATURE
# include <sys/mman.h>
# ifdef _WIN32
# include <evil_private.h> /* mmap */
# else
# include <sys/mman.h>
# endif
# ifdef HAVE_GNUTLS
# include <gnutls/gnutls.h>
# include <gnutls/x509.h>

@ -6,7 +6,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fnmatch.h>
#include <Ecore.h>

@ -6,7 +6,12 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#include <Ecore_File.h>

@ -29,8 +29,13 @@
# include <memcheck.h>
#endif
#ifdef HAVE_MMAP
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#ifdef HAVE_MMAP
// custom memory allocators to avoid malloc/free during backtrace handling
// just in case we're inside some signal handler due to mem corruption and

@ -36,9 +36,11 @@
#include <time.h>
#include <unistd.h>
# ifdef HAVE_MMAP
# include <sys/mman.h>
# endif
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define SWAP_64(x) x

@ -10,10 +10,15 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <inttypes.h>
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#include "eina_config.h"
#include "eina_private.h"

@ -23,7 +23,6 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>

@ -4,7 +4,10 @@
#include <Elementary.h>
#include "elm_priv.h"
#ifdef HAVE_SYS_MMAN_H
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif

@ -13,7 +13,6 @@
# include <Elput.h>
# include <ctype.h>
# include <sys/mman.h>
# include <fcntl.h>
# include <unistd.h>
# include <linux/vt.h>

@ -2,7 +2,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>

@ -1,9 +1,12 @@
#include <assert.h>
#ifdef HAVE_MMAP
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#ifdef _WIN32
# include <evil_private.h> /* mmap mprotect */
#else
# include <sys/mman.h>
#endif
#ifdef HAVE_VALGRIND

@ -12,9 +12,6 @@
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
#include <math.h>
#include "evas_private.h"

@ -2,7 +2,9 @@
# include "config.h" /* so that EAPI in Eet.h is correctly defined */
#endif
#ifdef HAVE_SYS_MMAN_H
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif

@ -10,7 +10,6 @@
#include <io.h>
#include "sys/mman.h"
#include "evil_private.h"
/*

@ -3,25 +3,6 @@
#include <sys/types.h>
#ifdef EAPI
# undef EAPI
#endif
#ifdef EFL_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif
#else
# define EAPI __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* @def PROT_NONE
@ -177,14 +158,5 @@ EAPI int munmap(void *addr,
EAPI int mprotect(void *addr, size_t len, int prot);
#ifdef __cplusplus
}
#endif
#undef EAPI
#define EAPI
#endif /* __EVIL_SYS_MMAN_H__ */

@ -49,6 +49,7 @@ extern "C" {
#include "evil_langinfo.h"
#include "evil_locale.h"
#include "evil_main.h"
#include "evil_mman.h"
#include "evil_stdlib.h"
#include "evil_stdio.h"
#include "evil_string.h"

@ -15,9 +15,7 @@ if target_machine.system() == 'windows'
'evil_time.h',
'evil_unistd.h',
'evil_util.h',
'dirent.h',
]
evil_header_sys_src = [join_paths('sys','mman.h')]
evil_src = [
'evil_dlfcn.c',

@ -14,9 +14,13 @@
#include <unistd.h>
#include <math.h>
#include <time.h>
#ifdef HAVE_SYS_MMAN_H
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

@ -2,15 +2,17 @@
#include "evas_private.h"
#include "evas_native_common.h"
#if defined HAVE_DLSYM && ! defined _WIN32
#if defined HAVE_DLSYM
# include <dlfcn.h> /* dlopen,dlclose,etc */
#elif _WIN32
# include <evil_private.h> /* dlopen dlclose dlsym */
# include <evil_private.h> /* dlopen dlclose dlsym mmap */
#else
# warning native_dmabuf should not get compiled if dlsym is not found on the system!
#endif
#include <sys/mman.h>
#ifndef _WIN32
# include <sys/mman.h>
#endif
#define DRM_FORMAT_ARGB8888 0x34325241
#define DRM_FORMAT_XRGB8888 0x34325258

@ -7,11 +7,16 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#ifdef _WIN32
# include <evil_private.h> /* mmap */
#else
# include <sys/mman.h>
#endif
#ifndef O_BINARY
# define O_BINARY 0
#endif

@ -5,7 +5,6 @@
#include <stdio.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

Loading…
Cancel
Save