summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-06-01 20:44:09 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-06-01 20:44:09 +0000
commit2cd6baae7e8cacd3fb32b97d225b73467d8199be (patch)
treea701fb95668c7c3da872f369513eb59c1128a739
parentbbe2d1cd12e06ea66eded7b7583e544d78a77792 (diff)
Eina : eina_module.c: fix dladdr use on Windows
SVN revision: 59882
-rw-r--r--src/lib/eina_module.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/eina_module.c b/src/lib/eina_module.c
index e2ca522..ca02065 100644
--- a/src/lib/eina_module.c
+++ b/src/lib/eina_module.c
@@ -88,6 +88,14 @@ static int EINA_MODULE_LOG_DOM = -1;
88#endif 88#endif
89#define DBG(...) EINA_LOG_DOM_DBG(EINA_MODULE_LOG_DOM, __VA_ARGS__) 89#define DBG(...) EINA_LOG_DOM_DBG(EINA_MODULE_LOG_DOM, __VA_ARGS__)
90 90
91#ifdef _WIN32
92# define SEP_C '\\'
93# define SEP_S "\\"
94#else
95# define SEP_C '/'
96# define SEP_S "/"
97#endif
98
91#define EINA_MODULE_SYMBOL_INIT "__eina_module_init" 99#define EINA_MODULE_SYMBOL_INIT "__eina_module_init"
92#define EINA_MODULE_SYMBOL_SHUTDOWN "__eina_module_shutdown" 100#define EINA_MODULE_SYMBOL_SHUTDOWN "__eina_module_shutdown"
93 101
@@ -144,7 +152,7 @@ static void _dir_list_cb(const char *name, const char *path, void *data)
144 152
145 file = alloca(sizeof (char) * length); 153 file = alloca(sizeof (char) * length);
146 154
147 snprintf(file, length, "%s/%s", path, name); 155 snprintf(file, length, "%s" SEP_S "%s", path, name);
148 m = eina_module_new(file); 156 m = eina_module_new(file);
149 if (!m) 157 if (!m)
150 { 158 {
@@ -169,7 +177,7 @@ static void _dir_arch_list_cb(const char *name, const char *path, void *data)
169 sizeof(SHARED_LIB_SUFFIX) + 1; 177 sizeof(SHARED_LIB_SUFFIX) + 1;
170 178
171 file = alloca(length); 179 file = alloca(length);
172 snprintf(file, length, "%s/%s/%s/module" SHARED_LIB_SUFFIX, 180 snprintf(file, length, "%s" SEP_S "%s" SEP_S "%s" SEP_S "module" SHARED_LIB_SUFFIX,
173 path, name, (char *)(cb_data->data)); 181 path, name, (char *)(cb_data->data));
174 m = eina_module_new(file); 182 m = eina_module_new(file);
175 if (!m) 183 if (!m)
@@ -497,7 +505,7 @@ EAPI char *eina_module_symbol_path_get(const void *symbol, const char *sub_dir)
497 505
498 if (dladdr(symbol, &eina_dl)) 506 if (dladdr(symbol, &eina_dl))
499 { 507 {
500 char *pos = strrchr(eina_dl.dli_fname, '/'); 508 char *pos = strrchr(eina_dl.dli_fname, SEP_C);
501 if (pos) 509 if (pos)
502 { 510 {
503 char *path; 511 char *path;