[vlc-commits] Implement plugin support for OS/2
KO Myung-Hun
git at videolan.org
Sat Oct 15 09:38:49 CEST 2011
vlc | branch: master | KO Myung-Hun <komh at chollian.net> | Mon Oct 10 20:44:19 2011 +0900| [e2557f5690c01b6dc98ccd171905ff0b8193ac90] | committer: Rémi Denis-Courmont
Implement plugin support for OS/2
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2557f5690c01b6dc98ccd171905ff0b8193ac90
---
src/Makefile.am | 1 +
src/modules/bank.c | 16 +++++++++++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 9cd6649..0e617e2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -280,6 +280,7 @@ SOURCES_libvlc_os2 = \
os2/dirs.c \
misc/atomic.c \
posix/filesystem.c \
+ posix/plugin.c \
os2/thread.c \
os2/specific.c \
$(NULL)
diff --git a/src/modules/bank.c b/src/modules/bank.c
index b6cf6d0..ad16102 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -426,10 +426,17 @@ static void AllocatePluginDir (module_bank_t *bank, unsigned maxdepth,
static const char suffix[] = "_plugin"LIBEXT;
size_t len = strlen (file);
+#ifndef __OS2__
/* Check that file matches the "lib*_plugin"LIBEXT pattern */
if (len > strlen (suffix)
&& !strncmp (file, prefix, strlen (prefix))
&& !strcmp (file + len - strlen (suffix), suffix))
+#else
+ /* We load all the files ending with LIBEXT on OS/2,
+ * because OS/2 has a 8.3 length limitation for DLL name */
+ if (len > strlen (LIBEXT)
+ && !strcasecmp (file + len - strlen (LIBEXT), LIBEXT))
+#endif
AllocatePluginFile (bank, abspath, relpath, &st);
}
else if (S_ISDIR (st.st_mode))
@@ -505,6 +512,13 @@ static int AllocatePluginFile (module_bank_t *bank, const char *abspath,
return 0;
}
+#ifdef __OS2__
+# define EXTERN_PREFIX "_"
+#else
+# define EXTERN_PREFIX
+#endif
+
+
/**
* Loads a dynamically-linked plug-in into memory and initialize it.
*
@@ -523,7 +537,7 @@ static module_t *module_InitDynamic (vlc_object_t *obj, const char *path,
return NULL;
/* Try to resolve the symbol */
- static const char entry_name[] = "vlc_entry" MODULE_SUFFIX;
+ static const char entry_name[] = EXTERN_PREFIX "vlc_entry" MODULE_SUFFIX;
vlc_plugin_cb entry =
(vlc_plugin_cb) module_Lookup (handle, entry_name);
if (entry == NULL)
More information about the vlc-commits
mailing list