[fpc-pascal] Porting C macro
Flávio Etrusco
flavio.etrusco at gmail.com
Tue Mar 12 09:50:08 CET 2013
On Tue, Mar 12, 2013 at 5:30 AM, Darius Blaszyk
<dhkblaszyk at zeelandnet.nl> wrote:
> function GETNEXT(x: pLList): pLList; inline;
> begin
> exit(pLList(pchar(x) - pchar(pLList(nil)^.next)));
> end;
>
> And let LList be declared as:
>
> LList = record
> len: integer;
> next, prev: pLList;
> name: PChar;
> nextname: PChar;
> flag: integer;
> end;
AFAICS you're missing an "address" operator:
@(pLList(nil)^.next)
Otherwise you decrement by 'next' value - which I hope is zero ;-)
-Flávio
More information about the fpc-pascal
mailing list