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

Måns Rullgård mans
Fri May 29 18:43:16 CEST 2009


Michael Kostylev <michael.kostylev at gmail.com> writes:

> On Fri, 22 May 2009 16:40:55 +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.  Tell me something new.

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



More information about the ffmpeg-devel mailing list