[vlc-commits] access_mms: fix linkage on OS/2

KO Myung-Hun git at videolan.org
Sat Dec 13 18:18:26 CET 2014


vlc/vlc-2.2 | branch: master | KO Myung-Hun <komh78 at gmail.com> | Mon Dec  8 11:58:18 2014 +0900| [117be772aa6157d78d9d488256bc582fe1efef73] | committer: Jean-Baptiste Kempf

access_mms: fix linkage on OS/2

-----
  CCLD     libaccess_mms_plugin.la
weakld: error: Unresolved symbol (UNDEF) '_vlc_poll'.
weakld: info: The symbol is referenced by:
    P:\tmp\ldconv_libaccess_mms_plugin_la-mmstu_38da54703f4316fd10.obj
Ignoring unresolved externals reported from weak prelinker.
Error! E2028: _vlc_poll is an undefined reference
file P:/tmp\ldconv_libaccess_mms_plugin_la-mmstu_38da54703f4316fd10.obj(ldconv_libaccess_mms_plugin_la-mmstu_38da54703f4316fd10.obj): undefined symbol _vlc_poll
-----

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
(cherry picked from commit f37b3cb09cd3266e4f50c4aaf754677cc0ea97b8)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=117be772aa6157d78d9d488256bc582fe1efef73
---

 include/vlc_threads.h |   19 ++++++++++++++++++-
 src/os2/thread.c      |    4 +++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 00435cb..d3f021b 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -391,7 +391,24 @@ struct vlc_cleanup_t
 #ifndef LIBVLC_USE_PTHREAD_CANCEL
 /* poll() with cancellation */
 # ifdef __OS2__
-int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout);
+static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
+{
+    static int (*vlc_poll_os2)(struct pollfd *, unsigned, int) = NULL;
+
+    if (!vlc_poll_os2)
+    {
+        HMODULE hmod;
+        CHAR szFailed[CCHMAXPATH];
+
+        if (DosLoadModule(szFailed, sizeof(szFailed), "vlccore", &hmod))
+            return -1;
+
+        if (DosQueryProcAddr(hmod, 0, "_vlc_poll_os2", (PFN *)&vlc_poll_os2))
+            return -1;
+    }
+
+    return (*vlc_poll_os2)(fds, nfds, timeout);
+}
 # else
 static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
 {
diff --git a/src/os2/thread.c b/src/os2/thread.c
index 0ddcc47..1f3885c 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -696,7 +696,9 @@ static int vlc_select( int nfds, fd_set *rdset, fd_set *wrset, fd_set *exset,
 
 }
 
-int vlc_poll( struct pollfd *fds, unsigned nfds, int timeout )
+/* Export vlc_poll_os2 directly regardless of EXPORTS of .def */
+__declspec(dllexport)
+int vlc_poll_os2( struct pollfd *fds, unsigned nfds, int timeout )
 {
     fd_set rdset, wrset, exset;
 



More information about the vlc-commits mailing list