[x264-devel] commit: shut up gcc warning in offsetof (Loren Merritt )

Måns Rullgård mans at mansr.com
Tue Mar 18 00:01:46 CET 2008


Loren Merritt <lorenm at u.washington.edu> writes:

> On Mon, 17 Mar 2008, Måns Rullgård wrote:
>> git at videolan.org (git version control) writes:
>>
>>> x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Mon Mar 17 01:23:35 2008 -0600| [4d9499b41be91645f27a7ca01e4a5a09d041ecbd]
>>>
>>> --- a/common/common.h
>>> +++ b/common/common.h
>>> @@ -37,7 +37,7 @@
>>>  #define FIX8(f) ((int)(f*(1<<8)+.5))
>>>
>>>  #ifndef offsetof
>>> -#define offsetof(T,F) ((unsigned int)((char *)&((T *)0)->F))
>>> +#define offsetof(T,F) ((unsigned long)((char *)&((T *)0)->F))
>>>  #endif
>>
>> That type should be size_t to match the standard offsetof().  BTW,
>> what system is missing offsetof?  It's been in the C standard for
>> quite some time.
>
> Huh, I just pasted it from ffmpeg without looking for a standard include.

It's in stddef.h.  I was just wondering what was doing in FFmpeg,
when I saw it was added by kabi...

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


More information about the x264-devel mailing list