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

KO Myung-Hun komh78 at gmail.com
Mon Oct 10 17:20:11 CEST 2011


Hi/2.

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 ?

> 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.

>> +#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;
> 
> 

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.0.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr




More information about the vlc-devel mailing list