aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-12-28 14:22:29 +0100
committerJean-Philippe Andre <jp.andre@samsung.com>2015-12-29 22:13:58 +0900
commit47ed848a8795c1b044f8be0dc6fb455f8bc13706 (patch)
tree758f9d41dbe0a4fb69a544d4bc1cea31421f6c38
parentEvas: Implement ARGY88 and GRY8 conversion to ARGB8888 (diff)
downloadefl-47ed848a8795c1b044f8be0dc6fb455f8bc13706.tar.gz
Evil: integrate the dlfcn code into Evil
This will remove some incompatibilities with other packages, especially for win-builds
-rw-r--r--configure.ac14
-rw-r--r--m4/efl_check_funcs.m46
-rw-r--r--src/Makefile_Ector.am4
-rw-r--r--src/Makefile_Eina.am4
-rw-r--r--src/Makefile_Evil.am30
-rw-r--r--src/bin/evil/evil_test_dlfcn.c1
-rw-r--r--src/lib/ecore/ecore_main.c4
-rw-r--r--src/lib/eina/eina_module.c2
-rw-r--r--src/lib/eina/eina_prefix.c2
-rw-r--r--src/lib/eo/eo.c2
-rw-r--r--src/lib/ethumb/ethumb.c1
-rw-r--r--src/lib/evil/Evil.h1
-rw-r--r--src/lib/evil/evil_dlfcn.c (renamed from src/lib/evil/dlfcn.c)3
-rw-r--r--src/lib/evil/evil_dlfcn.h (renamed from src/lib/evil/dlfcn.h)31
-rw-r--r--src/lib/evil/evil_stdio.h1
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api.c5
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext.c4
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_gles1.c4
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h6
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c2
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c5
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c2
-rw-r--r--src/modules/evas/engines/gl_sdl/evas_engine.c4
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c4
-rw-r--r--src/tests/evas/evas_test_evasgl.c5
-rw-r--r--src/tests/evil/evil_test_dlfcn.c1
26 files changed, 61 insertions, 87 deletions
diff --git a/configure.ac b/configure.ac
index 6e5953b321..a7f97c94a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -714,8 +714,6 @@ fi
AM_CONDITIONAL([WANT_SYSTEMD], [test "${want_systemd}" = "yes"])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "${want_systemd}" = "yes" -a "${have_systemd_pkg}" = "yes"])
#### Platform-dependent
-DL_LIBS=""
-DL_INTERNAL_LIBS=""
#### Evil
EFL_LIB_START_OPTIONAL([Evil], [test "${have_windows}" = "yes"])
@@ -729,10 +727,7 @@ EFL_SELECT_WINDOWS_VERSION
### Checks for libraries
-EFL_ADD_LIBS([EVIL], [-lole32 -lws2_32 -lsecur32 -luuid])
-EVIL_DLFCN_LIBS="-lpsapi"
-
-AC_SUBST([EVIL_DLFCN_LIBS])
+EFL_ADD_LIBS([EVIL], [-lpsapi -lole32 -lws2_32 -lsecur32 -luuid])
### Checks for header files
@@ -742,7 +737,7 @@ AC_SUBST([EVIL_DLFCN_LIBS])
### Checks for compiler characteristics
-EVIL_DLFCN_CPPFLAGS="-DEFL_EVIL_DLFCN_BUILD -DPSAPI_VERSION=1"
+EVIL_CPPFLAGS="-DPSAPI_VERSION=1"
# TODO: should we have these at EFL (global?)
# Note: these warnings should not be used with C++ code
EVIL_CFLAGS_WRN="-Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
@@ -753,7 +748,7 @@ if test "x${have_win32}" = "xyes" ; then
EVIL_CXXFLAGS="-fno-rtti -fno-exceptions -DSECURITY_WIN32 ${EVIL_CXXFLAGS}"
fi
-AC_SUBST([EVIL_DLFCN_CPPFLAGS])
+AC_SUBST([EVIL_CPPFLAGS])
AC_SUBST([EVIL_CFLAGS_WRN])
AC_SUBST([EVIL_CXXFLAGS])
@@ -761,9 +756,6 @@ AC_SUBST([EVIL_CXXFLAGS])
### Checks for library functions
-DL_LIBS="lib/evil/libdl.la"
-DL_INTERNAL_LIBS="lib/evil/libdl.la"
-
EFL_LIB_END_OPTIONAL([Evil])
AC_SUBST([USE_EVIL_CFLAGS])
diff --git a/m4/efl_check_funcs.m4 b/m4/efl_check_funcs.m4
index e538db74ef..24c3dbadf0 100644
--- a/m4/efl_check_funcs.m4
+++ b/m4/efl_check_funcs.m4
@@ -71,7 +71,7 @@ esac
case "$host_os" in
mingw*)
$2="yes"
- EFL_ADD_LIBS([$1], [lib/evil/libdl.la])
+ EFL_ADD_LIBS([$1], [lib/evil/libevil.la])
;;
*)
EFL_FIND_LIB_FOR_CODE([$1], [$dllibs], [$2], [[
@@ -100,7 +100,7 @@ esac
case "$host_os" in
mingw*)
$2="yes"
- EFL_ADD_LIBS([$1], [lib/evil/libdl.la])
+ EFL_ADD_LIBS([$1], [lib/evil/libevil.la])
;;
*)
EFL_FIND_LIB_FOR_CODE([$1], [$dllibs], [$2], [[
@@ -125,7 +125,7 @@ esac
case "$host_os" in
mingw*)
$2="yes"
- EFL_ADD_LIBS([$1], [lib/evil/libdl.la])
+ EFL_ADD_LIBS([$1], [lib/evil/libevil.la])
;;
*)
EFL_FIND_LIB_FOR_CODE([$1], [$dllibs], [$2], [[
diff --git a/src/Makefile_Ector.am b/src/Makefile_Ector.am
index 1855b17a6f..8f862c2a63 100644
--- a/src/Makefile_Ector.am
+++ b/src/Makefile_Ector.am
@@ -130,8 +130,8 @@ lib_ector_libector_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
@VALGRIND_CFLAGS@ \
@SSE3_CFLAGS@
-lib_ector_libector_la_LIBADD = @ECTOR_LIBS@ @DL_LIBS@
-lib_ector_libector_la_DEPENDENCIES = @ECTOR_INTERNAL_LIBS@ @DL_INTERNAL_LIBS@
+lib_ector_libector_la_LIBADD = @ECTOR_LIBS@
+lib_ector_libector_la_DEPENDENCIES = @ECTOR_INTERNAL_LIBS@
lib_ector_libector_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
### Unit tests
diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am
index 7e65a262f7..abfff07abf 100644
--- a/src/Makefile_Eina.am
+++ b/src/Makefile_Eina.am
@@ -241,8 +241,8 @@ lib_eina_libeina_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-DPACKAGE_DATA_DIR=\"$(datadir)/eina\" \
@VALGRIND_CFLAGS@
-lib_eina_libeina_la_LIBADD = @EINA_LIBS@ @DL_LIBS@ @UNWIND_LIBS@
-lib_eina_libeina_la_DEPENDENCIES = @EINA_INTERNAL_LIBS@ @DL_INTERNAL_LIBS@
+lib_eina_libeina_la_LIBADD = @EINA_LIBS@ @UNWIND_LIBS@
+lib_eina_libeina_la_DEPENDENCIES = @EINA_INTERNAL_LIBS@
lib_eina_libeina_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
### Binaries
diff --git a/src/Makefile_Evil.am b/src/Makefile_Evil.am
index 60fc567595..d4cc0beb00 100644
--- a/src/Makefile_Evil.am
+++ b/src/Makefile_Evil.am
@@ -2,11 +2,12 @@
if HAVE_WINDOWS
### Library
-lib_LTLIBRARIES += lib/evil/libevil.la lib/evil/libdl.la
+lib_LTLIBRARIES += lib/evil/libevil.la
install_evilheadersdir = $(includedir)/evil-@VMAJ@
dist_install_evilheaders_DATA = \
lib/evil/Evil.h \
+lib/evil/evil_dlfcn.h \
lib/evil/evil_fcntl.h \
lib/evil/evil_inet.h \
lib/evil/evil_langinfo.h \
@@ -22,7 +23,6 @@ lib/evil/evil_time.h \
lib/evil/evil_unistd.h \
lib/evil/evil_util.h \
lib/evil/dirent.h \
-lib/evil/dlfcn.h \
lib/evil/fnmatch.h \
lib/evil/pwd.h
@@ -32,6 +32,7 @@ lib/evil/sys/mman.h
lib_evil_libevil_la_SOURCES = \
lib/evil/evil_dirent.c \
+lib/evil/evil_dlfcn.c \
lib/evil/evil_fcntl.c \
lib/evil/evil_fnmatch.c \
lib/evil/evil_fnmatch_list_of_states.c \
@@ -51,6 +52,7 @@ lib/evil/evil_util.c \
lib/evil/evil_private.h \
lib/evil/evil_fnmatch_private.h
+lib_evil_libevil_la_CPPFLAGS = @EVIL_CPPFLAGS@
lib_evil_libevil_la_CFLAGS = @EVIL_CFLAGS@ @EVIL_CFLAGS_WRN@ -D__USE_MINGW_ANSI_STDIO
lib_evil_libevil_la_CXXFLAGS = @EVIL_CXXFLAGS@ @EVIL_CFLAGS@
lib_evil_libevil_la_LIBADD = @EVIL_LIBS@
@@ -71,23 +73,11 @@ lib/evil/regex/cname.h \
lib/evil/regex/regex2.h \
lib/evil/regex/utils.h
-lib_evil_libevil_la_CPPFLAGS = \
+lib_evil_libevil_la_CPPFLAGS += \
-I$(top_srcdir)/src/lib/evil \
-I$(top_srcdir)/src/lib/evil/regex \
-DPOSIX_MISTAKE
-#libdl
-
-lib_evil_libdl_la_SOURCES = lib/evil/dlfcn.c
-
-lib_evil_libdl_la_CPPFLAGS = \
--I$(top_builddir)/src/lib/efl \
-@EVIL_CFLAGS@ \
-@EVIL_DLFCN_CPPFLAGS@
-lib_evil_libdl_la_LIBADD = @USE_EVIL_LIBS@ @EVIL_DLFCN_LIBS@
-lib_evil_libdl_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
-lib_evil_libdl_la_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@
-
### Binary
bin_PROGRAMS += bin/evil/evil_suite bin/evil/test_evil
@@ -120,12 +110,12 @@ bin/evil/evil_test_util.h
#suite_SOURCES += bin/evil/memcpy_glibc_i686.S # see EXTRA_DIST below!
bin_evil_evil_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EVIL_CFLAGS@
-bin_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ @DL_LIBS@ -lm
-bin_evil_evil_suite_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@ @DL_INTERNAL_LIBS@
+bin_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ -lm
+bin_evil_evil_suite_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@
bin_evil_test_evil_SOURCES = bin/evil/test_evil.c
bin_evil_test_evil_LDADD = @USE_EVIL_LIBS@
-bin_evil_test_evil_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@ @DL_INTERNAL_LIBS@
+bin_evil_test_evil_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@
### Unit tests
@@ -147,8 +137,8 @@ tests_evil_evil_suite_CPPFLAGS = \
-DTESTS_BUILD_DIR=PACKAGE_BUILD_DIR \
@CHECK_CFLAGS@ \
@EVIL_CFLAGS@
-tests_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ @DL_LIBS@ @CHECK_LIBS@
-tests_evil_evil_suite_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@ @DL_INTERNAL_LIBS@
+tests_evil_evil_suite_LDADD = @USE_EVIL_LIBS@ @CHECK_LIBS@
+tests_evil_evil_suite_DEPENDENCIES = @USE_EVIL_INTERNAL_LIBS@
endif
diff --git a/src/bin/evil/evil_test_dlfcn.c b/src/bin/evil/evil_test_dlfcn.c
index b84a9eb238..605f5c4b68 100644
--- a/src/bin/evil/evil_test_dlfcn.c
+++ b/src/bin/evil/evil_test_dlfcn.c
@@ -3,7 +3,6 @@
#endif /* HAVE_CONFIG_H */
#include <string.h>
-#include <dlfcn.h>
#include <Evil.h>
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index f7e6a8a874..801e66eb08 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -172,7 +172,9 @@ timerfd_settime(int fd EINA_UNUSED,
#error No uv.h header found?
#endif
-#include <dlfcn.h>
+#if defined HAVE_DLOPEN && ! defined _WIN32
+# include <dlfcn.h>
+#endif
static uv_prepare_t _ecore_main_uv_prepare;
static uv_check_t _ecore_main_uv_check;
diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c
index 2cfcde7d38..41d1fb36b5 100644
--- a/src/lib/eina/eina_module.c
+++ b/src/lib/eina/eina_module.c
@@ -27,7 +27,7 @@
#include <libgen.h>
#include <unistd.h>
-#ifdef HAVE_DLOPEN
+#if defined HAVE_DLOPEN && ! defined _WIN32
# include <dlfcn.h>
#endif
diff --git a/src/lib/eina/eina_prefix.c b/src/lib/eina/eina_prefix.c
index a01b5fa7ff..2165d050c8 100644
--- a/src/lib/eina/eina_prefix.c
+++ b/src/lib/eina/eina_prefix.c
@@ -37,7 +37,7 @@
#include <unistd.h>
#include <limits.h>
-#ifdef HAVE_DLADDR
+#if defined HAVE_DLADDR && ! defined _WIN32
# include <dlfcn.h>
#endif
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index ef4a625af1..b2a498cc97 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -2,7 +2,7 @@
# include <config.h>
#endif
-#ifdef HAVE_DLADDR
+#if defined HAVE_DLADDR && ! defined _WIN32
# include <dlfcn.h>
#endif
diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c
index 7d21b0cbec..4e2c5a7c35 100644
--- a/src/lib/ethumb/ethumb.c
+++ b/src/lib/ethumb/ethumb.c
@@ -41,7 +41,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
-#include <dlfcn.h>
#include <ctype.h>
#include <pwd.h>
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index c4ee0a11cc..837803cebb 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -108,6 +108,7 @@ typedef unsigned long gid_t;
#include "evil_macro.h"
+#include "evil_dlfcn.h"
#include "evil_fcntl.h"
#include "evil_inet.h"
#include "evil_langinfo.h"
diff --git a/src/lib/evil/dlfcn.c b/src/lib/evil/evil_dlfcn.c
index 76fbf852fd..8dc07df9cf 100644
--- a/src/lib/evil/dlfcn.c
+++ b/src/lib/evil/evil_dlfcn.c
@@ -14,10 +14,9 @@
#include "evil_macro.h"
#include "evil_util.h"
+#include "evil_dlfcn.h"
#include "evil_private.h"
-#include "dlfcn.h"
-
static char *_dl_err = NULL;
static int _dl_err_viewed = 0;
diff --git a/src/lib/evil/dlfcn.h b/src/lib/evil/evil_dlfcn.h
index 349a9b4356..96fd30af80 100644
--- a/src/lib/evil/dlfcn.h
+++ b/src/lib/evil/evil_dlfcn.h
@@ -5,30 +5,8 @@
#include <limits.h>
-#ifdef EAPI
-# undef EAPI
-#endif /* EAPI */
-
-#ifdef _WIN32
-# ifdef EFL_EVIL_DLFCN_BUILD
-# ifdef DLL_EXPORT
-# define EAPI __declspec(dllexport)
-# else
-# define EAPI
-# endif /* ! DLL_EXPORT */
-# else
-# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EVIL_DLFCN_BUILD */
-#endif /* _WIN32 */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
/**
- * @file dlfcn.h
+ * @file evil_dlfcn.h
* @brief The file that provides functions to manage dynamic-link libraries
* @defgroup Evil_Dlfcn Functions that manage dynamic-link libraries.
* @ingroup Evil
@@ -181,7 +159,7 @@ EAPI void *dlopen(const char* path, int mode);
*
* @ingroup Evil_Dlfcn
*/
-EAPI int dlclose(void* handle);
+EAPI int dlclose(void* handle);
/**
* @brief Get the address of a symbol.
@@ -260,9 +238,4 @@ EAPI int dladdr (const void *addr, Dl_info *info);
EAPI char *dlerror (void);
-#ifdef __cplusplus
-}
-#endif
-
-
#endif /* __EVIL_DLFCN_H__ */
diff --git a/src/lib/evil/evil_stdio.h b/src/lib/evil/evil_stdio.h
index 1f65609ba2..7b61a33b57 100644
--- a/src/lib/evil/evil_stdio.h
+++ b/src/lib/evil/evil_stdio.h
@@ -10,7 +10,6 @@
*
* This header provides functions ported from Unix in stdio.h.
*
- *
*/
#define EVIL_PATH_SEP_SWAP(p, s1, s2) \
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c
index 42e6c7e78d..649b63a2d9 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api.c
@@ -1,7 +1,10 @@
#define GL_ERRORS_NODEF 1
#include "evas_gl_core_private.h"
#include "evas_gl_api_ext.h"
-#include <dlfcn.h>
+
+#ifndef _WIN32
+# include <dlfcn.h>
+#endif
#define EVGL_FUNC_BEGIN() if (UNLIKELY(_need_context_restore)) _context_restore()
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index b826df7850..adc9cbb072 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
@@ -1,7 +1,9 @@
#include "evas_gl_api_ext.h"
-#include <dlfcn.h>
+#ifndef _WIN32
+# include <dlfcn.h>
+#endif
#define EVGL_FUNC_BEGIN() if (UNLIKELY(_need_context_restore)) _context_restore()
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
index 28d4784338..0619c037ea 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
@@ -1,7 +1,9 @@
#define GL_ERRORS_NODEF 1
#include "evas_gl_core_private.h"
-#include <dlfcn.h>
+#ifndef _WIN32
+# include <dlfcn.h>
+#endif
#define EVGL_FUNC_BEGIN() if (UNLIKELY(_need_context_restore)) _context_restore()
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index 378a806f80..24a5c3a122 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -763,7 +763,11 @@ void pt_unref(Evas_GL_Texture_Pool *pt);
//#define GL_ERRORS_TRACE 1
#ifdef GL_ERRORS
-#include <dlfcn.h>
+
+# ifndef _WIN32
+# include <dlfcn.h>
+# endif
+
static inline void
__evas_gl_errdyn(int err, const char *file, const char *func, int line, const char *op)
{
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c
index 00445d8840..caf1619a33 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -1,7 +1,7 @@
#define _EVAS_GL_CONTEXT_C
#include "evas_gl_private.h"
-#ifdef HAVE_DLSYM
+#if defined HAVE_DLSYM && ! defined _WIN32
# include <dlfcn.h> /* dlopen,dlclose,etc */
#else
# error gl_common should not get compiled if dlsym is not found on the system!
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c
index 16e163b0e3..ba3496a99e 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -1,5 +1,8 @@
#include "evas_gl_core_private.h"
-#include <dlfcn.h>
+
+#ifndef _WIN32
+# include <dlfcn.h>
+#endif
// EVGL GL Format Pair
typedef struct _GL_Format
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index c462225056..24d2c06f4b 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -4,7 +4,7 @@
#include "software/Ector_Software.h"
#include "cairo/Ector_Cairo.h"
-#ifdef HAVE_DLSYM
+#if defined HAVE_DLSYM && ! defined _WIN32
# include <dlfcn.h> /* dlopen,dlclose,etc */
#else
# error gl_x11 should not get compiled if dlsym is not found on the system!
diff --git a/src/modules/evas/engines/gl_sdl/evas_engine.c b/src/modules/evas/engines/gl_sdl/evas_engine.c
index 56a2c7dc1d..8c70fba4ec 100644
--- a/src/modules/evas/engines/gl_sdl/evas_engine.c
+++ b/src/modules/evas/engines/gl_sdl/evas_engine.c
@@ -2,7 +2,9 @@
#include "evas_private.h"
#include "evas_engine.h"
-#include <dlfcn.h>
+#ifndef _WIN32
+# include <dlfcn.h>
+#endif
#include <SDL2/SDL_opengl.h>
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 73334c2957..728a736acb 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -10,9 +10,11 @@
#include <software/Ector_Software.h>
#include "cairo/Ector_Cairo.h"
-#ifdef HAVE_DLSYM
+#if defined HAVE_DLSYM && ! defined _WIN32
# include <dlfcn.h> /* dlopen,dlclose,etc */
+#endif
+#if defined HAVE_DLSYM
# define EVAS_GL 1
# define EVAS_GL_NO_GL_H_CHECK 1
# include "Evas_GL.h"
diff --git a/src/tests/evas/evas_test_evasgl.c b/src/tests/evas/evas_test_evasgl.c
index 8b7577723b..3263cfa74f 100644
--- a/src/tests/evas/evas_test_evasgl.c
+++ b/src/tests/evas/evas_test_evasgl.c
@@ -11,7 +11,10 @@
#endif
#include <stdio.h>
-#include <dlfcn.h>
+
+#ifndef _WIN32
+# include <dlfcn.h>
+#endif
#define EFL_GFX_FILTER_BETA
#include "evas_suite.h"
diff --git a/src/tests/evil/evil_test_dlfcn.c b/src/tests/evil/evil_test_dlfcn.c
index 28ee5b528e..0d0980e45d 100644
--- a/src/tests/evil/evil_test_dlfcn.c
+++ b/src/tests/evil/evil_test_dlfcn.c
@@ -20,7 +20,6 @@
# include "config.h"
#endif
-#include <dlfcn.h>
#include <Evil.h>
#include "evil_suite.h"