mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-25 05:57:37 +01:00
LCL: add all needed variants of CompareValue to prevent overloading problems (bug #8448)
git-svn-id: trunk@10868 -
This commit is contained in:
parent
f2b307fcaa
commit
e1b7c150ae
@ -26,6 +26,9 @@ unit FPCAdds;
|
|||||||
{$IFDEF VER2_3}
|
{$IFDEF VER2_3}
|
||||||
{$DEFINE FPC_HAS_QWORDCOMPAREVALUE}
|
{$DEFINE FPC_HAS_QWORDCOMPAREVALUE}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$IFNDEF VER2_0}
|
||||||
|
{$DEFINE FPC_HAS_COMPAREVALUE}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -41,6 +44,10 @@ type
|
|||||||
|
|
||||||
{$IFNDEF FPC_HAS_QWORDCOMPAREVALUE}
|
{$IFNDEF FPC_HAS_QWORDCOMPAREVALUE}
|
||||||
function CompareValue ( const A, B : QWord) : TValueRelationship; inline;
|
function CompareValue ( const A, B : QWord) : TValueRelationship; inline;
|
||||||
|
// other CompareValue functions have to be declare too, otherwise fpc
|
||||||
|
// doesn't find them: http://www.freepascal.org/mantis/view.php?id=8620
|
||||||
|
function CompareValue ( const A, B : Integer) : TValueRelationship; inline;
|
||||||
|
function CompareValue ( const A, B : Int64) : TValueRelationship; inline;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
function StrToWord(const s: string): word;
|
function StrToWord(const s: string): word;
|
||||||
|
|
||||||
@ -68,6 +75,34 @@ begin
|
|||||||
if a<b then
|
if a<b then
|
||||||
result:=LessThanValue;
|
result:=LessThanValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function CompareValue(const A, B: Integer): TValueRelationship; inline;
|
||||||
|
begin
|
||||||
|
{$IFDEF FPC_HAS_COMPAREVALUE}
|
||||||
|
Result := Math.CompareValue(A, B);
|
||||||
|
{$ELSE}
|
||||||
|
result:=GreaterThanValue;
|
||||||
|
if a=b then
|
||||||
|
result:=EqualsValue
|
||||||
|
else
|
||||||
|
if a<b then
|
||||||
|
result:=LessThanValue;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CompareValue(const A, B: Int64): TValueRelationship; inline;
|
||||||
|
begin
|
||||||
|
{$IFDEF FPC_HAS_COMPAREVALUE}
|
||||||
|
Result := Math.CompareValue(A, B);
|
||||||
|
{$ELSE}
|
||||||
|
result:=GreaterThanValue;
|
||||||
|
if a=b then
|
||||||
|
result:=EqualsValue
|
||||||
|
else
|
||||||
|
if a<b then
|
||||||
|
result:=LessThanValue;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user