[Ffmpeg-devel] More of the BeOS fixes...

Måns Rullgård mans
Thu Mar 8 21:30:44 CET 2007


"Fran?ois Revol" <revol at free.fr> writes:

> This is my current diff against trunk.
> The recent removal of PRI* and *INT64_C broke the BeOS build, and as 
> some of you probably noticed, I got quite pissed off at it after 

The pissed-off-ness is somewhat mutual.

> cleaning the beos port for 2 weeks or so...
> Yes, Haiku will get those someday, yes Zeta will likely too, but no 
> BeOS R5 won't have them ever, so they are required.
> As for the rest it's mostly what barpainet.h was, so it could then be 
> removed. 
> (and no, R5 didn't have SO_SNDBUF)
>
> As always, non constructive comments will go to /dev/null.
>
> Fran?ois.
>
> Index: configure
> ===================================================================
> --- configure	(revision 8296)
> +++ configure	(working copy)
> @@ -590,6 +590,7 @@
>      altivec_h
>      armv5te
>      armv6
> +    arpa_inet_h
>      byteswap_h
>      cmov
>      dcbzl
> @@ -1508,6 +1509,8 @@
>
>  check_header byteswap.h
>
> +check_header arpa/inet.h
> +
>  check_func inet_aton
>  check_func localtime_r
>  enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"

OK

> Index: libavutil/internal.h
> ===================================================================
> --- libavutil/internal.h	(revision 8296)
> +++ libavutil/internal.h	(working copy)
> @@ -46,6 +46,39 @@
>  #define M_PI    3.14159265358979323846
>  #endif
>
> +#ifdef ARCH_X86_32
> +/* sensible default values for 32 bit, will definitely not work anywhere else! */
> +
> +#    ifndef PRId64
> +#    define PRId64 "lld"
> +#    endif
> +
> +#    ifndef PRIu64
> +#    define PRIu64 "llu"
> +#    endif
> +
> +#    ifndef PRIx64
> +#    define PRIx64 "llx"
> +#    endif
> +
> +#    ifndef PRIX64
> +#    define PRIX64 "llX"
> +#    endif
> +
> +#    ifndef PRId32
> +#    define PRId32 "d"
> +#    endif
> +
> +#    ifndef PRIdFAST16
> +#    define PRIdFAST16 PRId32
> +#    endif
> +
> +#    ifndef PRIdFAST32
> +#    define PRIdFAST32 PRId32
> +#    endif
> +
> +#endif /* ARCH_X86_32 */
> +
>  #ifndef INT16_MIN
>  #define INT16_MIN       (-0x7fff-1)
>  #endif
> @@ -86,6 +119,15 @@
>  #    endif
>  #endif
>
> +#ifndef INT64_C
> +#    if defined(__GNUC__) && defined(ARCH_X86_32)
> +#        define INT64_C(c)     (c ## LL)
> +#        define UINT64_C(c)    (c ## ULL)
> +#    else
> +#        error [U]INT64_C not declared on this platform.
> +#    endif
> +#endif
> +
>  #if ( defined(__PIC__) || defined(__pic__) ) && ! defined(PIC)
>  #    define PIC
>  #endif

Rejected for reasons explained ad nauseum.

> Index: libavformat/os_support.c
> ===================================================================
> --- libavformat/os_support.c	(revision 8296)
> +++ libavformat/os_support.c	(working copy)
> @@ -78,7 +78,7 @@
>  #if !defined(HAVE_INET_ATON) && defined(CONFIG_NETWORK)
>  #include <stdlib.h>
>  #include <strings.h>
> -#include "barpainet.h"
> +#include "network.h"
>
>  int inet_aton (const char * str, struct in_addr * add)
>  {

Probably OK.

> Index: libavformat/udp.c
> ===================================================================
> --- libavformat/udp.c	(revision 8296)
> +++ libavformat/udp.c	(working copy)
> @@ -394,6 +394,7 @@
>      }
>  #endif
>
> +#ifdef SO_SNDBUF
>      if (is_output) {
>          /* limit the tx buf size to limit latency */
>          tmp = UDP_TX_BUF_SIZE;
> @@ -402,6 +403,7 @@
>              goto fail;
>          }
>      }
> +#endif
>
>      s->udp_fd = udp_fd;
>      return 0;

OK.  I don't suppose there are systems where SO_SNDBUF is an enum or
something.

> Index: libavformat/network.h
> ===================================================================
> --- libavformat/network.h	(revision 8296)
> +++ libavformat/network.h	(working copy)
> @@ -24,7 +24,22 @@
>  #include <sys/types.h>
>  #include <sys/socket.h>
>  #include <netinet/in.h>
> +#ifdef HAVE_ARPA_INET_H
>  #include <arpa/inet.h>
> +#else
> +#    if !defined(HAVE_INET_ATON)
> +/* in os_support.c */
> +int inet_aton (const char * str, struct in_addr * add);
> +#    endif
> +#endif

The existence of arpa/inet.h and inet_aton are independent.

>  #include <netdb.h>
>
> +#if !defined(IP_ADD_MEMBERSHIP)
> +/* just so structs have a storage size */
> +struct ip_mreq {
> +    struct in_addr imr_multiaddr;  /* IP multicast address of group */
> +    struct in_addr imr_interface;  /* local IP address of interface */
> +};
>  #endif

This is bad.  Whatever uses that struct should be conditionally
compiled, as it can't possibly work with a fake definition like this.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list