anchor.diff:  implementation
   
   uses
  -  SysUtils, AbExcept;
  +  Math, SysUtils, AbExcept;
   
   {Notes: The buffer is a circular queue without a head pointer; FTail
           is where data is next going to be written and it wraps
  
positive.code:   inc(FSize, Count);
    FPosn := FSize;
    FBufPosn := FTail;
    Result := Count;
  end;
  {--------}
  function TAbBitBucketStream.Seek(const Offset : Int64; Origin : TSeekOrigin): Int64;
  var
    Posn : longint;
    BytesBack : longint;
  begin
  {$IFDEF LINUX}
  
negative.code:   Chunk2Size : longint;
    Chunk1Size : longint;
    InBuffer   : PByte;
    Overage    : longint;
  begin
    Result := Count;
    InBuffer := @Buffer;
    {we cannot write more bytes than there is buffer}
    while Count > FBufSize do begin
      Overage := Min(FBufSize, Count - FBufSize);
      Write(InBuffer^, Overage);
      Inc(PtrInt(InBuffer), Overage);
      Dec(Count, Overage);
    end;
    {calculate the size of the chunks}
    Chunk1Size := FBufSize - FTail;
    if (Chunk1Size > Count) then begin
  