David Laight wrote:
> On Tue, Apr 22, 2008 at 11:50:05PM +0900, Dmitry Timoshkov wrote:
> > "Erik de Castro Lopo" <[EMAIL PROTECTED]> wrote:
> >
> > > /* get pointer to object containing list element */
> > > #define LIST_ENTRY(elem, type, field) \
> > > -((type *)((char *)(elem) - (unsigned
On Tue, Apr 22, 2008 at 11:50:05PM +0900, Dmitry Timoshkov wrote:
> "Erik de Castro Lopo" <[EMAIL PROTECTED]> wrote:
>
> > /* get pointer to object containing list element */
> > #define LIST_ENTRY(elem, type, field) \
> > -((type *)((char *)(elem) - (unsigned int)(&((type *)0)->field)))
> > +
> 3) Add a definition if FIELD_OFFSET wrapped in #ifndef. This is the
> least ugly option but would cause surprising results if one or
> the other was changed.
Personally, I think this looks the best. As far as which is likely to
get accepted.. often you have to try first to find that o
Dmitry Timoshkov wrote:
> "Erik de Castro Lopo" <[EMAIL PROTECTED]> wrote:
>
> > FIELD_OFFSET is defined in include/winnt.h.
> >
> > Now I could include winnt.h into include/wine/list.h but that doesn't
> > seem right. I could also copy it,but having two definitions of the
> > same macro is als
"Erik de Castro Lopo" <[EMAIL PROTECTED]> wrote:
>> > /* get pointer to object containing list element */
>> > #define LIST_ENTRY(elem, type, field) \
>> > -((type *)((char *)(elem) - (unsigned int)(&((type *)0)->field)))
>> > +((type *)((char *)(elem) - (unsigned long)(&((type *)0)->field
Dmitry Timoshkov wrote:
> "Erik de Castro Lopo" <[EMAIL PROTECTED]> wrote:
>
> > /* get pointer to object containing list element */
> > #define LIST_ENTRY(elem, type, field) \
> > -((type *)((char *)(elem) - (unsigned int)(&((type *)0)->field)))
> > +((type *)((char *)(elem) - (unsigned
"Erik de Castro Lopo" <[EMAIL PROTECTED]> wrote:
> /* get pointer to object containing list element */
> #define LIST_ENTRY(elem, type, field) \
> -((type *)((char *)(elem) - (unsigned int)(&((type *)0)->field)))
> +((type *)((char *)(elem) - (unsigned long)(&((type *)0)->field)))
It shou