mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 00:19:26 +02:00
* 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:
parent
409d3e41fb
commit
f2b307fcaa
@ -22,18 +22,15 @@
|
|||||||
unit FPCAdds;
|
unit FPCAdds;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}{$inline on}
|
{$mode objfpc}{$H+}{$inline on}
|
||||||
{$IFDEF VER2_0_2}
|
|
||||||
{$DEFINE FPC_HAS_NO_STRTOQWORD}
|
{$IFDEF VER2_3}
|
||||||
|
{$DEFINE FPC_HAS_QWORDCOMPAREVALUE}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Math
|
Classes, SysUtils, Math;
|
||||||
{$IFDEF FPC_HAS_NO_STRTOQWORD}
|
|
||||||
,sysconst
|
|
||||||
{$ENDIF}
|
|
||||||
;
|
|
||||||
|
|
||||||
// current TStream calculates in int64, old in longint
|
// current TStream calculates in int64, old in longint
|
||||||
type
|
type
|
||||||
@ -42,11 +39,10 @@ type
|
|||||||
TCompareMemSize = integer;
|
TCompareMemSize = integer;
|
||||||
PHandle = ^THandle;
|
PHandle = ^THandle;
|
||||||
|
|
||||||
|
{$IFNDEF FPC_HAS_QWORDCOMPAREVALUE}
|
||||||
function CompareValue ( const A, B : QWord) : TValueRelationship; inline;
|
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}
|
{$ENDIF}
|
||||||
|
function StrToWord(const s: string): word;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -62,8 +58,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFNDEF FPC_HAS_QWORDCOMPAREVALUE}
|
||||||
function CompareValue ( const A, B : QWord) : TValueRelationship;
|
function CompareValue ( const A, B : QWord) : TValueRelationship;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result:=GreaterThanValue;
|
result:=GreaterThanValue;
|
||||||
if a=b then
|
if a=b then
|
||||||
@ -72,14 +68,6 @@ begin
|
|||||||
if a<b then
|
if a<b then
|
||||||
result:=LessThanValue;
|
result:=LessThanValue;
|
||||||
end;
|
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}
|
{$ENDIF}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user