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

Víctor Paesa wzrlpy
Mon Aug 20 13:27:05 CEST 2007


Ramiro Ribeiro Polla said:
>> Hi,
>> The attached patch (from Ramiro) fixes post SVN-r9988 Cygwin builds,
>> as discussed here:
>> http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/2007-August/008963.html
>> Another patch to fix cross-compiles for MinGW under Cygwin is yet
>> needed.
> Is there no way to tell Cygwin not to use the w32api?
> The Cygwin FAQ says that programs that support winsock2 shouldn't try
> porting to unix sockets. Isn't it better to make Cygwin also use
> winsock2 then?

I have investigated that route:

a) Use "check_header winsock2.h || check_header arpa/inet.h" in configure.
b) --extra-cflags=-D__USE_W32_SOCKETS in configure invocation to use
Winsock instead of POSIX (Cygwin's FAQ wrongly mentions -D__USE_W32_WINSOCK)

Then the build fails with:
gcc -I"/home/wzrlpy/src/ffmpeg-10145/ffmpeg-checkout-2007-08-20"/libavcodec
-D__USE_W32_SOCKETS -DX_DISPLAY_MISSING -fomit-frame-pointer -march=prescott
-g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization
-Wpointer-arith -Wredundant-decls -O3  -c -o utils.o utils.c
In file included from /usr/include/cygwin/sys_time.h:13,
                 from /usr/include/sys/time.h:27,
                 from utils.c:26:
/usr/include/sys/select.h:31: error: parse error before "fd_set"

The file /usr/include/sys/types.h explains the reason:
"Note that a program which includes the W32api winsock[2].h header must
know what it is doing; it must not call the cygwin32 select function."

select() is used in multiple places in FFMpeg, so using winsock2 in
Cygwin port becomes not trivial (and with no clear benefit): I prefer
to keep on using the POSIX calls.


More information about the ffmpeg-devel mailing list