lazarus/lcl/fpcadds.pas
vincents 79896c7112 - removed 1.x specific FindGlobalComponent
- added writing stack trace of exception in Application.HandleException

git-svn-id: trunk@7260 -
2005-06-21 14:41:16 +00:00

81 lines
2.1 KiB
ObjectPascal

{ $Id$ }
{
/***************************************************************************
FPCAdds.pas
-----------
***************************************************************************/
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.LCL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
unit FPCAdds;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
// current TStream calculates in int64, old in longint
type
TStreamSeekType = int64;
TMemStreamSeekType = integer;
TCompareMemSize = integer;
PHandle = ^THandle;
function StrToWord(const s: string): word;
{$IFDEF VER2_0_0}
// These functions were introduced after fpc 2.0.0
function ExceptFrameCount: Longint;
function ExceptFrames: PPointer;
{$ENDIF}
implementation
function StrToWord(const s: string): word;
var
p: Integer;
begin
Result:=0;
p:=1;
while (p<=length(s)) do begin
Result:=Result*10+ord(s[p])-ord('0');
inc(p);
end;
end;
{$IFDEF VER2_0_0}
function ExceptFrameCount: Longint;
begin
If RaiseList=Nil then
Result:=0
else
Result:=RaiseList^.Framecount;
end;
function ExceptFrames: PPointer;
begin
If RaiseList=Nil then
Result:=Nil
else
Result:=RaiseList^.Frames;
end;
{$ENDIF}
end.