[FFmpeg-devel] [PATCH] use standard integer types in libavdevice/bktr.c

Michael Kostylev michael.kostylev
Sat May 30 14:13:51 CEST 2009


On Fri, 29 May 2009 17:43:16 +0100
M?ns Rullg?rd wrote:

>>>> libavdevice/bktr.c uses the BSD (?) variants like u_int64_t of standard
>>>> integer types like uint64_t.  Here is a patch to change the file to the
>>>> standard types that we use in other places, which I think is desirable.
>>>> It's not compile-tested since I do not have access to a BSD system, but
>>>> it should be trivial.
>>> That file will only be used on BSD systems, so I don't see a problem.
>>> The headers probably already use the BSD types, and mismatches might
>>> result in compiler warnings (or worse).
>> bktr.c really includes the headers containing the BSD types which typedefs
>> may be protected by some specific macros like __BSD_VISIBLE on FreeBSD and
>> _NETBSD_SOURCE on NetBSD. __BSD_VISIBLE is zeroed and _NETBSD_SOURCE is
>> undefined when _POSIX_C_SOURCE is defined.
>> FreeBSD:
>> /usr/include/dev/bktr/ioctl_meteor.h:53: error: expected specifier-qualifier-list before 'u_short'
>> /usr/include/dev/bktr/ioctl_meteor.h:61: error: expected specifier-qualifier-list before 'u_long'
>> /usr/include/dev/bktr/ioctl_meteor.h:70: error: expected specifier-qualifier-list before 'u_long'
>> /usr/include/dev/bktr/ioctl_bt848.h:94: error: expected specifier-qualifier-list before 'u_char'
>> /usr/include/dev/bktr/ioctl_bt848.h:195: error: expected specifier-qualifier-list before 'u_int'
>> Btw, the IPPROTO_IPV6 macro is also protected by #if __BSD_VISIBLE:
>> ...libavformat/udp.c:77: error: 'IPPROTO_IPV6' undeclared (first use in this function)
>> NetBSD:
>> /usr/include/dev/ic/bt8xx.h:60: error: expected specifier-qualifier-list before 'u_short'
>> /usr/include/dev/ic/bt8xx.h:68: error: expected specifier-qualifier-list before 'u_int'
>> /usr/include/dev/ic/bt8xx.h:77: error: expected specifier-qualifier-list before 'u_int'
>> /usr/include/dev/ic/bt8xx.h:287: error: expected specifier-qualifier-list before 'u_char'
>> /usr/include/dev/ic/bt8xx.h:388: error: expected specifier-qualifier-list before 'u_int'
> So the headers are buggy. 

It doesn't matter. The "bug", which was introduced as a feature, is already
released. The question is whether two extra add_cflags will make configure
uglier. For comparison, take a look how someone is reinventing the system
headers:
http://groups.google.com/group/mailing.freebsd.ports-bugs/msg/85eaeb7fbd97ad49

Michael



More information about the ffmpeg-devel mailing list