summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/evil/ChangeLog5
-rw-r--r--legacy/evil/configure.ac10
-rw-r--r--legacy/evil/src/lib/dlfcn/Makefile.am2
-rw-r--r--legacy/evil/src/lib/dlfcn/dlfcn.c27
4 files changed, 39 insertions, 5 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index 632eb44f86..a0943d290c 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -6,6 +6,11 @@
6 add inet_ntop() function. Implementation from c-ares library. 6 add inet_ntop() function. Implementation from c-ares library.
7 See AUTHORS. 7 See AUTHORS.
8 8
9 * configure.ac:
10 * src/lib/dlfcn/dlfcn.c:
11 * src/lib/dlfcn/Makefile.am:
12 add RTLD_DEFAULT support in dlsym() on Windows CE
13
92011-09-14 Vincent Torri <doursse at users dot sf dot net> 142011-09-14 Vincent Torri <doursse at users dot sf dot net>
10 15
11 * src/lib/dlfcn/dlfcn.c: 16 * src/lib/dlfcn/dlfcn.c:
diff --git a/legacy/evil/configure.ac b/legacy/evil/configure.ac
index a29d8d4825..8c2a021c00 100644
--- a/legacy/evil/configure.ac
+++ b/legacy/evil/configure.ac
@@ -99,21 +99,25 @@ AC_C___ATTRIBUTE__
99win32_cppflags="-DEFL_EVIL_BUILD" 99win32_cppflags="-DEFL_EVIL_BUILD"
100win32_cflags="-Wall -Wextra -Wshadow -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls" 100win32_cflags="-Wall -Wextra -Wshadow -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
101win32_cxxflags="" 101win32_cxxflags=""
102win32_libs=""
102have_wince="no" 103have_wince="no"
103case "$host_os" in 104case "$host_os" in
104 mingw32ce*) 105 mingw32ce*)
105 have_wince="yes" 106 have_wince="yes"
106 win32_cppflags="${win32_cppflags} -D_WIN32_WCE=0x0420" 107 win32_cppflags="${win32_cppflags} -D_WIN32_WCE=0x0420"
108 win32_libs="-ltoolhelp"
107 ;; 109 ;;
108 *) 110 *)
109 have_wince="no" 111 have_wince="no"
110 win32_cxxflags="-fno-rtti -fno-exceptions" 112 win32_cxxflags="-fno-rtti -fno-exceptions"
111 win32_cppflags="${win32_cppflags} -D_WIN32_WINNT=0x0501 -DSECURITY_WIN32" 113 win32_cppflags="${win32_cppflags} -D_WIN32_WINNT=0x0501 -DSECURITY_WIN32"
114 win32_libs="-lpsapi"
112 ;; 115 ;;
113esac 116esac
114AC_SUBST(win32_cppflags) 117AC_SUBST([win32_cppflags])
115AC_SUBST(win32_cflags) 118AC_SUBST([win32_cflags])
116AC_SUBST(win32_cxxflags) 119AC_SUBST([win32_cxxflags])
120AC_SUBST([win32_libs])
117 121
118AM_CONDITIONAL(EVIL_HAVE_WINCE, test "x${have_wince}" = "xyes") 122AM_CONDITIONAL(EVIL_HAVE_WINCE, test "x${have_wince}" = "xyes")
119 123
diff --git a/legacy/evil/src/lib/dlfcn/Makefile.am b/legacy/evil/src/lib/dlfcn/Makefile.am
index cfb35a6663..65409973fd 100644
--- a/legacy/evil/src/lib/dlfcn/Makefile.am
+++ b/legacy/evil/src/lib/dlfcn/Makefile.am
@@ -11,5 +11,5 @@ libdl_la_SOURCES = dlfcn.c
11 11
12libdl_la_CPPFLAGS = @win32_cppflags@ -DEFL_EVIL_DLFCN_BUILD -DPSAPI_VERSION=1 12libdl_la_CPPFLAGS = @win32_cppflags@ -DEFL_EVIL_DLFCN_BUILD -DPSAPI_VERSION=1
13libdl_la_CFLAGS = @win32_cflags@ 13libdl_la_CFLAGS = @win32_cflags@
14libdl_la_LIBADD = $(top_builddir)/src/lib/libevil.la $(EFL_MPATROL_LIBS) -lpsapi 14libdl_la_LIBADD = $(top_builddir)/src/lib/libevil.la $(EFL_MPATROL_LIBS) @win32_libs@
15libdl_la_LDFLAGS = -no-undefined -Wl,--enable-auto-import -version-info @version_info@ 15libdl_la_LDFLAGS = -no-undefined -Wl,--enable-auto-import -version-info @version_info@
diff --git a/legacy/evil/src/lib/dlfcn/dlfcn.c b/legacy/evil/src/lib/dlfcn/dlfcn.c
index f08c905af5..9daa94675b 100644
--- a/legacy/evil/src/lib/dlfcn/dlfcn.c
+++ b/legacy/evil/src/lib/dlfcn/dlfcn.c
@@ -9,7 +9,11 @@
9#endif /* __MINGW32CE__ || _MSC_VER */ 9#endif /* __MINGW32CE__ || _MSC_VER */
10 10
11#include <windows.h> 11#include <windows.h>
12#include <psapi.h> /* EnumProcessModules(Ex) */ 12#ifdef _WIN32_WCE
13# include <tlhelp32.h> /* CreateToolhelp32Snapshot */
14#else
15# include <psapi.h> /* EnumProcessModules(Ex) */
16#endif
13 17
14#include "../Evil.h" 18#include "../Evil.h"
15 19
@@ -131,6 +135,26 @@ dlsym(void *handle, const char *symbol)
131 135
132 if (handle == RTLD_DEFAULT) 136 if (handle == RTLD_DEFAULT)
133 { 137 {
138#ifdef _WIN32_WCE
139 HANDLE snapshot;
140 MODULEENTRY32 module;
141
142 snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS |
143 TH32CS_SNAPMODULE |
144 TH32CS_GETALLMODS,
145 0);
146 if (!snapshot)
147 return NULL;
148
149 module.dwSize = sizeof(module);
150 if (Module32First(snapshot, &module))
151 do {
152 fp = GetProcAddress(module.hModule, new_symbol);
153 if (fp) break;
154 } while (Module32Next(snapshot, &module));
155
156 CloseToolhelp32Snapshot(snapshot);
157#else
134 HMODULE modules[1024]; 158 HMODULE modules[1024];
135 DWORD needed; 159 DWORD needed;
136 DWORD i; 160 DWORD i;
@@ -145,6 +169,7 @@ dlsym(void *handle, const char *symbol)
145 fp = GetProcAddress(modules[i], new_symbol); 169 fp = GetProcAddress(modules[i], new_symbol);
146 if (fp) break; 170 if (fp) break;
147 } 171 }
172#endif
148 } 173 }
149 else 174 else
150 fp = GetProcAddress(handle, new_symbol); 175 fp = GetProcAddress(handle, new_symbol);