[vlc-devel] [PATCH 07/41] Implement select()-able pipes for OS/2
KO Myung-Hun
komh at chollian.net
Mon Oct 10 13:43:46 CEST 2011
---
src/misc/objects.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/misc/objects.c b/src/misc/objects.c
index fa36923..fe7186d 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -52,10 +52,17 @@
# include <search.h>
#endif
-#ifndef WIN32
-# include <vlc_fs.h>
-# include <unistd.h>
-#else
+#ifdef __OS2__
+# include <sys/socket.h>
+# include <netinet/in.h>
+
+typedef int SOCKET;
+typedef struct sockaddr_in SOCKADDR_IN;
+typedef struct sockaddr *PSOCKADDR;
+
+# define closesocket soclose
+# define INVALID_SOCKET -1
+#elif defined(WIN32)
# include <io.h>
# include <winsock2.h>
# include <ws2tcpip.h>
@@ -65,6 +72,9 @@
# define write( a, b, c ) send (a, b, c, 0)
# undef close
# define close( a ) closesocket (a)
+#else
+# include <vlc_fs.h>
+# include <unistd.h>
#endif
#include <limits.h>
@@ -287,7 +297,7 @@ static void vlc_object_destroy( vlc_object_t *p_this )
}
-#ifdef WIN32
+#if defined(WIN32) || defined(__OS2__)
/**
* select()-able pipes emulated using Winsock
*/
@@ -329,7 +339,7 @@ error:
closesocket (c);
return -1;
}
-#endif /* WIN32 */
+#endif /* WIN32 || __OS2__ */
static vlc_mutex_t pipe_lock = VLC_STATIC_MUTEX;
--
1.7.3.2
More information about the vlc-devel
mailing list