[opus] [PATCH] stream.c needs sys/types.h

Ozkan Sezer sezeroz at gmail.com
Wed May 1 05:54:13 PDT 2013

On Wed, May 1, 2013 at 3:40 PM, Ozkan Sezer <sezeroz at gmail.com> wrote:
> On Wed, May 1, 2013 at 3:26 PM, Ross Bencina <rossb-lists at audiomulch.com> wrote:
>> [sorry Diego, meant to send this to list]
>> On 1/05/2013 9:48 PM, Diego Elio Pettenò wrote:
>>  > Uhm I would probably suggest adding a check for this as I'm not sure
>>  > if all operating systems have or need sys/types.h.
>> Well I don't think off_t is an ANSI C type in the first place.
>> More likely this is POSIX code. And sys/types.h is a POSIX header:
>> http://en.wikipedia.org/wiki/C_POSIX_library
>> If ANSI compatibility is desired I think that fpos_t is the correct type.
> Well, off_t is used to cast the offset value being passed to fseeko(),
> so I don't think that fpos_t is suitable there. My fseeko() man page
> says:  int fseeko(FILE *stream, off_t offset, int whence);

Hmph, it seems like fseeko() may be prototyped differently in different
versions of the same OS: OSX SDK <= 10.4 has the offset as fpos_t which
is defined either as __int64_t or __darwin_off_t, but as off_t in 10.5.
So what I said previously seems wrong.

OTOH, the need for sys/types.h is there unless the cast is removed..

>> Ross.
> --
> O.S.


More information about the opus mailing list