[vlc-devel] commit: vlc_poll: no conditional symbols ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Aug 7 21:49:58 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Thu Aug  7 22:49:00 2008 +0300| [6625284102fdfb850aedbe80bdc88f28d6d08efa] | committer: Rémi Denis-Courmont 

vlc_poll: no conditional symbols

I would rather we move all the replacement functions to a dedicated
static import library (in future versions) though. It kinda sucks to
clutter libvlccore with such symbols.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6625284102fdfb850aedbe80bdc88f28d6d08efa
---

 include/vlc_network.h |    3 ++-
 src/libvlccore.sym    |    2 +-
 src/network/poll.c    |   11 +++++++++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/vlc_network.h b/include/vlc_network.h
index aca2b0a..2f57af7 100644
--- a/include/vlc_network.h
+++ b/include/vlc_network.h
@@ -181,7 +181,8 @@ struct pollfd
     int revents;
 };
 
-  VLC_EXPORT (int, poll, (struct pollfd *fds, unsigned nfds, int timeout));
+VLC_EXPORT (int, vlc_poll, (struct pollfd *fds, unsigned nfds, int timeout));
+# define poll(a, b, c) vlc_poll(a, b, c)
 #endif
 
 #ifdef WIN32
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 0d4039d..839260f 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -278,7 +278,6 @@ playlist_ServicesDiscoveryRemove
 playlist_TreeMove
 __pl_Release
 __pl_Yield
-poll
 resolve_xml_special_chars
 sdp_AddAttribute
 sdp_AddMedia
@@ -452,6 +451,7 @@ __vlc_object_unlock
 __vlc_object_wait
 __vlc_object_waitpipe
 __vlc_object_yield
+vlc_poll
 vlc_pthread_fatal
 vlc_rand_bytes
 vlc_recvmsg
diff --git a/src/network/poll.c b/src/network/poll.c
index 540bc1d..2bef3f5 100644
--- a/src/network/poll.c
+++ b/src/network/poll.c
@@ -27,12 +27,19 @@
 
 #include <vlc_common.h>
 
-#ifndef HAVE_POLL
+#ifdef HAVE_POLL
+struct pollfd;
+
+int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
+{
+    return poll (fds, nfds, timeout);
+}
+#else /* !HAVE_POLL */
 #include <string.h>
 #include <stdlib.h>
 #include <vlc_network.h>
 
-int poll (struct pollfd *fds, unsigned nfds, int timeout)
+int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
 {
     fd_set rdset, wrset, exset;
     struct timeval tv = { 0, 0 };




More information about the vlc-devel mailing list