krfkeith / la-pe

Automatically exported from code.google.com/p/la-pe
0 stars 0 forks source link

lpexceptions.pas function ReturnAddress for XE2 UP #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
XE2 UP has a built-in implementation function (ReturnAddress). You can now 
write the cross-platform for "lpexceptions.pas":

implementation

{$IFDEF Delphi}
{$IF CompilerVersion < 21.00}
function ReturnAddress: Pointer;
asm
  MOV  EAX, [EBP+4]
end;
{$IFEND}
{$ENDIF}

procedure _LapeException(Msg: lpString); inline;
{$IFDEF FPC}
begin
...
end;
{$ELSE}
begin
  raise lpException.Create(Msg) at ReturnAddress;
end;
{$ENDIF}
...

Original issue reported on code.google.com by pult....@gmail.com on 8 Dec 2012 at 2:49

GoogleCodeExporter commented 9 years ago
Thanks! Applied your patch :)

Original comment by niels....@gmail.com on 14 Dec 2012 at 7:07