fixes to correct compile in Delphi Tokyo and Rio

This commit is contained in:
Régys Borges da Silveira 2019-02-19 09:01:27 -03:00
parent 4929253007
commit 7dc71dea5d
3 changed files with 15 additions and 3 deletions

View File

@ -84,7 +84,10 @@ uses
function TMVCCache.SetValue(const AName: string; const AValue: TValue): TMVCCacheItem;
var
lCacheItem: TMVCCacheItem;
Value: TValue;
begin
Value := AValue;
FMREW.DoWithWriteLock(
procedure
var
@ -92,13 +95,13 @@ begin
begin
if FStorage.TryGetValue(AName, lItem) then
begin
lItem.Value := AValue;
lItem.Value := Value;
end
else
begin
lCacheItem := TMVCCacheItem.Create;
try
lCacheItem.Value := AValue;
lCacheItem.Value := Value;
FStorage.Add(AName, lCacheItem);
except
lCacheItem.Free;

View File

@ -231,7 +231,12 @@ end;
procedure TMVCAbstractSerializer.RegisterTypeSerializer(const ATypeInfo: PTypeInfo; AInstance: IMVCTypeSerializer);
begin
{$IFDEF NEXTGEN}
LogD('Registering TypeSerializer for: ' + PChar(Pointer(ATypeInfo.Name)));
{$ELSE}
LogD('Registering TypeSerializer for: ' + string(ATypeInfo.Name));
{$ENDIF}
FTypeSerializers.AddOrSetValue(ATypeInfo, AInstance);
end;

View File

@ -366,7 +366,7 @@ begin
ftFMTBcd, ftBCD:
AJsonObject.F[FieldName] := BcdToDouble(ADataSet.Fields[I].AsBcd);
ftGraphic, ftBlob, ftStream:
ftGraphic, ftBlob, ftStream, ftOraBlob:
begin
MS := TMemoryStream.Create;
try
@ -1085,7 +1085,11 @@ begin
end;
tkFloat:
begin
{$IFDEF NEXTGEN}
if PChar(Pointer(Value.TypeInfo.Name)) = 'TDate' then
{$ELSE}
if Value.TypeInfo.Name = 'TDate' then
{$ENDIF}
begin
JSON.DUtc[KeyName] := Value.AsExtended;
end