[FFmpeg-devel] [PATCH] fix post r9988 Cygwin builds

Ramiro Ribeiro Polla ramiro
Sun Aug 12 03:40:50 CEST 2007


 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.

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:
#ifdef HAVE_WINSOCK2_H
winsock
#else
assume arpa/inet.h and its normal networking code
#endif

Attached patch changes to:
#ifdef HAVE_ARPA_INET_H
arpa/inet.h
#else
assume winsock and its badly designed networking code
#endif

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

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arpa_inet.diff
Type: text/x-patch
Size: 2506 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070811/cc5561dc/attachment.bin>



More information about the ffmpeg-devel mailing list