[fpc-pascal] Porting C macro

Darius Blaszyk dhkblaszyk at zeelandnet.nl
Mon Mar 11 23:26:57 CET 2013


 

I'm stuck porting a macro from C. Below is the original define. The
part I'm struggeling with is the right most part after the - sign.


#define GETNEXT(x) ((LList *)(((char *) x) - ((char *) & (((LList
*)0)^.next))))

Does anyone know what is meant with the define?
Obviously LList is a linked list struct that has a prev and next
variable. But what does the & and 0 mean?

Appreciate any
help.

Regards, Darius 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130311/6e7db602/attachment.html>


More information about the fpc-pascal mailing list