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

Måns Rullgård mans
Fri Mar 9 15:03:37 CET 2007


Fran?ois Revol said:
>> > Index: libavutil/internal.h
>> > [...]
>> > +#    ifndef PRId64
>> > +#    define PRId64 "lld"
>> > +#    endif
>> > [...]
>> > +#ifndef INT64_C
>> > [...]
>>
>> Rejected for reasons explained ad nauseum.
>
> I yet have to see a valid reason for this.
> Those things are an after-thought addition to standards, that came in
> way after some OSes shipping date.
> You can't expect those OSes to fix their header because some dumb
> standard appeared 5 years later. That's a bad standard. A correct
> correct would have dictated using default values for the platform in
> existance before it.
> Anyway, I won't back that one up.

The C99 standard is 8 years old.  Yes, that's right: EIGHT YEARS, practically
an eternity in the field of computers.

You can't expect to run modern programs on antediluvian operating systems.
That's just how things work.

> There is no reason to start floating fake headers for mingw, beos,
> riscos and whatever when a single default could be provided.

"Floating fake headers" is what we'd be doing if we included those
random typedefs in FFmpeg.  A friendly person made a "single default"
for use with msvc.  Feel free to do the same for beos.

> I don't think the misbehaviours that were refered to actually happen on
> those regular 32bit platforms we used for 20 years. 64bit platforms are
> recent enough for OSes running on them to be actively maintained
> anyway, appart alpha.

You don't know that for sure.

>> > 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.
>
> Right, they are supposed to be declared in, but some other OS probably
> declare it elsewhere...
> Thing is the configure check is actually broken on BeOS-BONE, because
> it is actually __inet_aton, so it fails to link to it while it actually
> exists. I can probably fake the check instead in configure.

This could easily be #defined in config.h.  Would this mean that we no longer
need the replacement implementation?

>> >  #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.
>
> The code is actually ifdefed out, but not the ip_mreq member of the
> context struct. So it's declared even if unused. I didn't find
> #ifdeffing struct members really sane, but I suppose it won't give a
> bin compatibility problem.

>From a brief look at the code, it seems that this is a private struct defined
in udp.c.  Conditionally declaring the troublesome members of the struct should
pose no problem at all.

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




More information about the ffmpeg-devel mailing list