* removed fpc 2.0.2 workarounds from fpcadds

* only add CompareValue(qword, qword) for fpc versions that don't have it.

git-svn-id: trunk@10867 -
This commit is contained in:
vincents 2007-04-04 10:35:52 +00:00
parent 409d3e41fb
commit f2b307fcaa

View File

@ -22,18 +22,15 @@
unit FPCAdds;
{$mode objfpc}{$H+}{$inline on}
{$IFDEF VER2_0_2}
{$DEFINE FPC_HAS_NO_STRTOQWORD}
{$IFDEF VER2_3}
{$DEFINE FPC_HAS_QWORDCOMPAREVALUE}
{$ENDIF}
interface
uses
Classes, SysUtils, Math
{$IFDEF FPC_HAS_NO_STRTOQWORD}
,sysconst
{$ENDIF}
;
Classes, SysUtils, Math;
// current TStream calculates in int64, old in longint
type
@ -42,11 +39,10 @@ type
TCompareMemSize = integer;
PHandle = ^THandle;
{$IFNDEF FPC_HAS_QWORDCOMPAREVALUE}
function CompareValue ( const A, B : QWord) : TValueRelationship; inline;
function StrToWord(const s: string): word;
{$IFDEF FPC_HAS_NO_STRTOQWORD}
function StrToQWord(const s: string): QWord;
{$ENDIF}
function StrToWord(const s: string): word;
implementation
@ -62,8 +58,8 @@ begin
end;
end;
{$IFNDEF FPC_HAS_QWORDCOMPAREVALUE}
function CompareValue ( const A, B : QWord) : TValueRelationship;
begin
result:=GreaterThanValue;
if a=b then
@ -72,14 +68,6 @@ begin
if a<b then
result:=LessThanValue;
end;
{$IFDEF FPC_HAS_NO_STRTOQWORD}
function StrToQWord(const s: string): QWord;
var Error: word;
begin
Val(S, result, Error);
if Error <> 0 then raise EConvertError.createfmt(SInvalidInteger,[S]);
end;
{$ENDIF}
end.