[MPlayer-dev-eng] [PATCH] 'socklen_t' definition
Michael Kostylev
mik at niipt.ru
Sun Mar 2 23:40:40 CET 2008
At Sat, 01 Mar 2008 23:39:51 +0900,
KO Myung-Hun wrote:
>>>>> Currently, 'HAVE_SOCKLEN_T 1' is defined unconditionally. But some
>>>>> systems such as OS/2 do not support 'socklen_t' type. So we need to
>>>>> check and to typedef it if not supported.
>>>> Your patch can break cross-compiling.
>>> Why and what case ?
>>
>> E.g. building on linux:
>>
>> % gcc -O -I. -DCODECS2HTML codec-cfg.c -o codec-cfg
>> In file included from codec-cfg.c:28:
>> config.h:1539: error: conflicting types for `socklen_t'
>> /usr/include/unistd.h:243: error: previous declaration of `socklen_t'
>>
>> % gcc -E -O -I. -DCODECS2HTML codec-cfg.c | grep socklen_t
>> __extension__ typedef unsigned int __socklen_t;
>> typedef __socklen_t socklen_t;
>> typedef int socklen_t;
>>
> BTW, your sys/socket.h does not have typedef for socklen_t ? Strange.
>>> So, would you mind giving me advice to avoid that problem ?
>> I didn't discover it but tried '#define socklen_t int' instead of typedef.
> Ok. I've updated the patch to check unistd.h as well.
> How about this ?
Even worse, no need to include unistd.h
I'm afraid you don't understand what cross-compiling is.
Michael
More information about the MPlayer-dev-eng
mailing list