[FFmpeg-devel] [PATCH] socklen_t definition

KO Myung-Hun komh
Mon Sep 17 15:42:14 CEST 2007


Hi/2.

M?ns Rullg?rd wrote:
> KO Myung-Hun wrote:
>   
>> Hi/2.
>>     
>
> Is that half a hi?
>
>   

It's the 'hi' ported to OS/2. ^^

>> M?ns Rullg?rd wrote:
>>     
>>> KO Myung-Hun <komh at chollian.net> writes:
>>>
>>>
>>>       
>>>> Index: configure
>>>> ===================================================================
>>>> --- configure	(revision 10425)
>>>> +++ configure	(working copy)
>>>> @@ -534,6 +535,26 @@
>>>>  EOF
>>>>  }
>>>>
>>>> +check_type(){
>>>> +    log check_type "$@"
>>>> +    headers=$1
>>>> +    type=$2
>>>> +    shift 2
>>>> +    disable $type
>>>> +    incs=""
>>>> +    for hdr in $headers; do
>>>> +        incs="$incs
>>>> +#include <$hdr>"
>>>> +    done
>>>> +    check_ld "$@" <<EOF && enable $type
>>>> +$incs
>>>> +int main(){
>>>> +    $type v;
>>>> +    return 0;
>>>> +}
>>>> +EOF
>>>> +}
>>>>
>>>>         
>>> There's no need for a main() function or to run the linker.  All you
>>> need is check_cc with a global declaration.
>>>
>>>
>>>       
>> Ah, like this ?
>>     
>
> Yes, like that.
>
> As for the rest of the patch, how do we know that int is the correct
> type to use if socklen_t doesn't exist?  Using the wrong type could
> be dangerous.  On Beos we know it's int, but we can't be sure in the
> general case.
>
>   

I agree with you that this can be wrong in general case. But I think, 
this is better than current one which define socklen_t in according to 
OSes. Because even on same OS, build envs of different vendor or 
different version can have socklen_t definition or not. And if other 
OSes or build env require socklen_t that is not 'int', we can add 
another condition for those at that time.

Or, we can place current definition in 'HAVE_SOCKLEN_T' condition.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.4
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 750 MHz with 512 MB RAM

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






More information about the ffmpeg-devel mailing list