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

KO Myung-Hun komh78 at gmail.com
Tue Oct 11 13:00:11 CEST 2011



Rémi Denis-Courmont wrote:
> 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.
> 

The reason why I prefer to use 'define',

    1. I can reuse the codes without modifying them.
    2. I can stop monitoring of the code changes.
       This is very important to me because it can save my time
       to port.
    3. As you know, OS/2 and Win32 have the same root,
       so they have the same/similar features and restriction.
       As a result, sometimes Win32 specific codes can be used for
       OS/2 as well.

Nevertheless, if your policy is to use OS-specific codes, I'll do that.

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