23 Apr
2008
23 Apr
'08
10:09 p.m.
On Tue, Apr 22, 2008 at 11:50:05PM +0900, Dmitry Timoshkov wrote:
"Erik de Castro Lopo" <mle+win(a)mega-nerd.com> 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)))
How about: ((type *)((char *)(elem) - ((char *)(&((type *)0)->field) - (char *)0))) David -- David Laight: david(a)l8s.co.uk