From 617d56f23af75d9060a7ad70d95b812b334f99c2 Mon Sep 17 00:00:00 2001 From: Ondrej Pokorny Date: Wed, 10 Jul 2024 11:38:42 +0200 Subject: [PATCH] Move EqualsValue/LessThanValue/GreaterThanValue to unit Types, refer to them in the Math unit --- rtl/objpas/math.pp | 23 ++++++++++++++++------- rtl/objpas/types.pp | 6 ++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/rtl/objpas/math.pp b/rtl/objpas/math.pp index 2c3edaa24f..28da25ee0a 100644 --- a/rtl/objpas/math.pp +++ b/rtl/objpas/math.pp @@ -56,10 +56,10 @@ interface {$ifndef FPUNONE} {$IFDEF FPC_DOTTEDUNITS} uses - System.SysUtils; + System.SysUtils, System.Types; {$ELSE FPC_DOTTEDUNITS} uses - sysutils; + sysutils, types; {$ENDIF FPC_DOTTEDUNITS} {$IFDEF FPDOC_MATH} @@ -144,13 +144,22 @@ Const EInvalidArgument = class(ematherror); - TValueRelationship = -1..1; +{$IFDEF FPC_DOTTEDUNITS} + TValueRelationship = System.Types.TValueRelationship; +{$ELSE FPC_DOTTEDUNITS} + TValueRelationship = types.TValueRelationship; +{$ENDIF FPC_DOTTEDUNITS} const - EqualsValue = 0; - LessThanValue = Low(TValueRelationship); - GreaterThanValue = High(TValueRelationship); - +{$IFDEF FPC_DOTTEDUNITS} + EqualsValue = System.Types.EqualsValue; + LessThanValue = System.Types.LessThanValue; + GreaterThanValue = System.Types.GreaterThanValue; +{$ELSE FPC_DOTTEDUNITS} + EqualsValue = types.EqualsValue; + LessThanValue = types.LessThanValue; + GreaterThanValue = types.GreaterThanValue; +{$ENDIF FPC_DOTTEDUNITS} {$push} diff --git a/rtl/objpas/types.pp b/rtl/objpas/types.pp index 45052701df..9d99b78d4b 100644 --- a/rtl/objpas/types.pp +++ b/rtl/objpas/types.pp @@ -47,6 +47,12 @@ type TDirection = (FromBeginning, FromEnd); TValueRelationship = -1..1; +const + LessThanValue = Low(TValueRelationship); + EqualsValue = 0; + GreaterThanValue = High(TValueRelationship); + +type DWORD = LongWord; PLongint = System.PLongint;