Eina : eina_module.c: fix dladdr use on Windows

SVN revision: 59881
This commit is contained in:
Vincent Torri 2011-06-01 20:43:01 +00:00
parent 4b5440650e
commit 888fd92769
1 changed files with 11 additions and 3 deletions

View File

@ -86,6 +86,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"
@ -142,7 +150,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)
{
@ -167,7 +175,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)
@ -391,7 +399,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;