[FFmpeg-cvslog] r21148 - trunk/configure

Michael Kostylev michael.kostylev
Mon Jan 11 22:37:39 CET 2010


On Mon Jan 11 18:42:16 2010
rbultje wrote:

> Author: rbultje
> Date: Mon Jan 11 18:42:15 2010
> New Revision: 21148
> 
> Log:
> Check for struct sockaddr_storage. Patch by Martin Storsj?
> <$firstname()$firstname,st>.
> 
> Modified:
>    trunk/configure
> 
> Modified: trunk/configure
> ==============================================================================
> --- trunk/configure	Mon Jan 11 18:32:40 2010	(r21147)
> +++ trunk/configure	Mon Jan 11 18:42:15 2010	(r21148)
> @@ -990,6 +990,7 @@ HAVE_LIST="
>      soundcard_h
>      poll_h
>      struct_addrinfo
> +    struct_sockaddr_storage
>      sys_mman_h
>      sys_resource_h
>      sys_select_h
> @@ -2451,6 +2452,7 @@ texi2html -version > /dev/null 2>&1 && e
>  if enabled network; then
>      check_type "sys/types.h sys/socket.h" socklen_t
>      check_type netdb.h "struct addrinfo"
> +    check_type sys/socket.h "struct sockaddr_storage"
>      # Prefer arpa/inet.h over winsock2
>      if check_header arpa/inet.h ; then
>          check_func closesocket

The test fails on OpenBSD:
check_type sys/socket.h struct sockaddr_storage
check_cc
BEGIN /usr/src/fate/build/tmp/ffconf.XXXXX...26485.c
    1
    2   #include <sys/socket.h>
    3   struct sockaddr_storage v;
END /usr/src/fate/build/tmp/ffconf.XXXXX...26485.c
ccache gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -std=c99 -fomit-frame-pointer -fPIC -c
-o /usr/src/fate/build/tmp/ffconf.XXXXX...26485.o /usr/src/fate/build/tmp/ffconf.XXXXX...26485.c
In file included from /usr/src/fate/build/tmp/ffconf.XXXXX...26485.c:2:
/usr/include/sys/socket.h:152: error: syntax error before "u_int8_t"
/usr/include/sys/socket.h:170: error: syntax error before "u_int8_t"
/usr/include/sys/socket.h:173: error: syntax error before "u_int64_t"
/usr/include/sys/socket.h:239: error: syntax error before "uid_t"
/usr/include/sys/socket.h:244: error: syntax error before "gid_t"
/usr/include/sys/socket.h:372: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:376: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:398: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:454: error: syntax error before "caddr_t"
/usr/include/sys/socket.h:458: error: syntax error before "caddr_t"
In file included from /usr/src/fate/build/tmp/ffconf.XXXXX...26485.c:2:
/usr/include/sys/socket.h:469: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:470: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:471: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:472: error: syntax error before "uid_t"
/usr/include/sys/socket.h:473: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:474: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:475: error: syntax error before "socklen_t"
/usr/include/sys/socket.h:477: error: syntax error before "recv"
/usr/include/sys/socket.h:477: error: syntax error before "size_t"
/usr/include/sys/socket.h:478: error: syntax error before "recvfrom"
/usr/include/sys/socket.h:478: error: syntax error before "size_t"
/usr/include/sys/socket.h:479: error: syntax error before "recvmsg"
/usr/include/sys/socket.h:480: error: syntax error before "send"
/usr/include/sys/socket.h:480: error: syntax error before "size_t"
/usr/include/sys/socket.h:481: error: syntax error before "sendto"
/usr/include/sys/socket.h:482: error: syntax error before "size_t"
/usr/include/sys/socket.h:483: error: syntax error before "sendmsg"
/usr/include/sys/socket.h:484: error: syntax error before "socklen_t"

It seems sys/socket.h is completely unusable without sys/types.h,
but the latter is not included from the former. A workaround:
#include <sys/types.h>
#include <sys/socket.h>
struct sockaddr_storage v;

Michael



More information about the ffmpeg-cvslog mailing list