diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2011-06-01 20:44:09 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2011-06-01 20:44:09 +0000 |
commit | 2cd6baae7e8cacd3fb32b97d225b73467d8199be (patch) | |
tree | a701fb95668c7c3da872f369513eb59c1128a739 | |
parent | bbe2d1cd12e06ea66eded7b7583e544d78a77792 (diff) | |
download | eina-2cd6baae7e8cacd3fb32b97d225b73467d8199be.tar.gz |
Eina : eina_module.c: fix dladdr use on Windows
SVN revision: 59882
-rw-r--r-- | src/lib/eina_module.c | 14 |
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; #endif #define DBG(...) EINA_LOG_DOM_DBG(EINA_MODULE_LOG_DOM, __VA_ARGS__) +#ifdef _WIN32 +# define SEP_C '\\' +# define SEP_S "\\" +#else +# define SEP_C '/' +# define SEP_S "/" +#endif + #define EINA_MODULE_SYMBOL_INIT "__eina_module_init" #define EINA_MODULE_SYMBOL_SHUTDOWN "__eina_module_shutdown" @@ -144,7 +152,7 @@ static void _dir_list_cb(const char *name, const char *path, void *data) file = alloca(sizeof (char) * length); - snprintf(file, length, "%s/%s", path, name); + snprintf(file, length, "%s" SEP_S "%s", path, name); m = eina_module_new(file); if (!m) { @@ -169,7 +177,7 @@ static void _dir_arch_list_cb(const char *name, const char *path, void *data) sizeof(SHARED_LIB_SUFFIX) + 1; file = alloca(length); - snprintf(file, length, "%s/%s/%s/module" SHARED_LIB_SUFFIX, + snprintf(file, length, "%s" SEP_S "%s" SEP_S "%s" SEP_S "module" SHARED_LIB_SUFFIX, path, name, (char *)(cb_data->data)); m = eina_module_new(file); if (!m) @@ -497,7 +505,7 @@ EAPI char *eina_module_symbol_path_get(const void *symbol, const char *sub_dir) if (dladdr(symbol, &eina_dl)) { - char *pos = strrchr(eina_dl.dli_fname, '/'); + char *pos = strrchr(eina_dl.dli_fname, SEP_C); if (pos) { char *path; |