[vlc-devel] [PATCH 07/41] Implement select()-able pipes for OS/2

Rémi Denis-Courmont remi at remlab.net
Mon Oct 10 17:33:54 CEST 2011


Le lundi 10 octobre 2011 18:20:11 KO Myung-Hun, vous avez écrit :
> Rémi Denis-Courmont wrote:
> > Le lundi 10 octobre 2011 14:43:46 KO Myung-Hun, vous avez écrit :
> >> ---
> >> 
> >>  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
> > 
> > Hmmph. Yeah right :-) I would rather have rewritten the code below to not
> > be Windows-specific, than defined Winsock types on OS/2.
> 
> Do you mean that I should rewrite the same codes for OS/2 again ?

Considering that we assume that SOCKET is int and INVALID_SOCKET is -1 
everywhere *else* in the VLC code base, you might as well edit the code into 
more OS/2 & POSIX style. I wrote originally it in Windows style because it was 
only used on Windows.

> > Is it so that OS/2 does not have pipes?
> 
> OS/2 has pipes, but select() of kLIBC on OS/2 works only on sockets.

Grmbl...

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list