[FFmpeg-devel] [PATCH] fix post r9988 Cygwin builds
Ramiro Ribeiro Polla
ramiro
Wed Aug 22 01:18:24 CEST 2007
Ramiro Ribeiro Polla wrote:
> wrote:
>> Ramiro Polla <ramiro at lisha.ufsc.br> writes:
>>
>
> [...]
>
>>> use_winsock2.diff makes network.h check if winsock2 is to be used.
>>>
>>
>> I still don't see why you're doing it like this. Why not just replace
>> #ifdef HAVE_WINSOCK2_H with #ifdef HAVE_ARPA_INET_H and swap the sides
>> of the else. Since one of the two will be defined if networking is
>> enabled, this will accomplish the same thing.
>
> It's not as simple because winsock mostly adds stuff on top of the
> normal networking code. Cygwin can't use the winsock code.
>
Did you understand why it is not as simple as just inverting #ifdefs?
> Attached patch assumes network either arpa/inet.h or winsock.2, and
> nothing else.
>
> It would be best if the fallback from the #ifdef was to normal code,
> like in ff_socket_nonblock(). This would the best if Cygwin accepted it:
1.
> #ifdef HAVE_WINSOCK2_H
> winsock
> #else
> assume arpa/inet.h and its normal networking code
> #endif
>
2.
> Attached patch changes to:
> #ifdef HAVE_ARPA_INET_H
> arpa/inet.h
> #else
> assume winsock and its badly designed networking code
> #endif
>
3.
> Another alternative (presented in a previous patch):
> #if !defined(HAVE_ARPA_INET_H) && defined(HAVE_WINSOCK2_H)
> winsock
> #else
> arpa/inet.h and its normal networking code
> #endif
>
4.
#if !defined(HAVE_ARPA_INET_H) && defined(HAVE_WINSOCK2_H)
#define USE_WINSOCK2_H
#endif
and change HAVE_WINSOCK2_H to USE_WINSOCK2_H where appropriate.
Please consider any of the 4 alternatives presented with #ifdefs.
There is also a 5th alternative which is checking in configure.
Another issue rises for Cygwin since check_func2 winsock2.h closesocket
defines HAVE_CLOSESOCKET for Cygwin, while it shouldn't. That's why I
prefer checking in configure.
Here are my updated patches to try and clean network checking in configure.
I'll commit them in a couple of days if there are no objections.
Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: network_41.diff
Type: text/x-patch
Size: 1616 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070821/3ae7378e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: network_42.diff
Type: text/x-patch
Size: 341 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070821/3ae7378e/attachment-0001.bin>
More information about the ffmpeg-devel
mailing list