Skip to content

Commit fe2a3f0

Browse files
Fix compilation with XE5 and earlier (no StrToUInt64Def)
1 parent c9f45a9 commit fe2a3f0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Source/DUnitX.Utils.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,9 +1214,11 @@ function ConvStr2Int(const ASource: TValue; ATarget: PTypeInfo; out AResult: TVa
12141214

12151215
function ConvStr2Ord(const ASource: TValue; ATarget: PTypeInfo; out AResult: TValue): Boolean;
12161216
begin
1217+
{$IFDEF DELPHI_XE6_UP}
12171218
if ATarget = System.TypeInfo(UInt64) then
12181219
AResult := TValue.FromOrdinal(ATarget, StrToUInt64Def(ASource.AsString, 0))
12191220
else
1221+
{$ENDIF}
12201222
AResult := TValue.FromOrdinal(ATarget, StrToInt64Def(ASource.AsString, 0));
12211223
Result := True;
12221224
end;

Source/DUnitX.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
{$DEFINE DELPHI_XE4_UP}
7575
{$IFEND}
7676

77+
{$IF CompilerVersion > 26.0} // XE6 up
78+
{$DEFINE DELPHI_XE6_UP}
79+
{$IFEND}
80+
81+
7782

7883
{$IF CompilerVersion > 28.0} // XE8 up
7984
{$DEFINE DELPHI_XE8_UP}

0 commit comments

Comments
 (0)