[FFmpeg-devel] [PATCH] fix post r9988 Cygwin builds
Måns Rullgård
mans
Sun Aug 12 02:08:05 CEST 2007
Ramiro Polla <ramiro at lisha.ufsc.br> writes:
> M?ns Rullg?rd wrote:
>> Ramiro Polla <ramiro at lisha.ufsc.br> writes:
>>
>>
>>> M?ns Rullg?rd wrote:
>>>
>>>> Ramiro Polla <ramiro at lisha.ufsc.br> writes:
>>>>
>>>>
>>>>
>>>>> M?ns Rullg?rd wrote:
>>>>>
>>>>>
>>>>>> Ramiro Polla <ramiro at lisha.ufsc.br> writes:
>>>>>>
>>>>>>
>>>>>>> Two patches attached.
>>>>>>>
>>>>>>> Ramiro Polla
>>>>>>> Index: configure
>>>>>>> ===================================================================
>>>>>>> --- configure (revision 10072)
>>>>>>> +++ configure (working copy)
>>>>>>> @@ -1537,7 +1537,7 @@
>>>>>>> check_header termios.h
>>>>>>> check_header conio.h
>>>>>>>
>>>>>>> -check_header arpa/inet.h
>>>>>>> +check_header arpa/inet.h ||
>>>>>>> check_header winsock2.h
>>>>>>>
>>>>>>>
>>>>>> Why the || ?
>>>>>>
>>>>>>
>>>>> This is the fix for Cygwin, which has both arpa/inet.h and
>>>>> winsock2.h. It can't use both.
>>>>>
>>>> Shouldn't some ifdeffery in the code take care of that?
>>>>
>>> Are you seriously suggesting that you'd prefer ifdeffery? You'll be
>>> contradicting yourself if you do. Just in case you really want to
>>> consider it, attached is ifdeffery.diff
>>>
>>
>> I would have thought something like this would do it:
>>
>> #ifdef HAVE_ARPA_INET_H
>> /* standard network stuff */
>> #elif defined HAVE_WINSOCK2_H
>> /* winsock stuff */
>> #else
>> /* no network stuff, if needed */
>> #endif
>
> os_support_network.diff moves the CONFIG_NETWORK #ifdef to have effect
> over the whole file, since everything on os_support.c depends on
> network. It is needed for the next patch to work, since network.h must
> be included before winsock is checked for.
The poll() emulation doesn't depend on network, although it is only
used by ffserver.
> 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.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list