Browse Source

[flexValue] fixed fpc compatibility

Exilon 5 years ago
parent
commit
a8c5f6817d
2 changed files with 6 additions and 2 deletions
  1. 2 2
      Quick.Value.RTTI.pas
  2. 4 0
      Quick.Value.pas

+ 2 - 2
Quick.Value.RTTI.pas

@@ -91,9 +91,9 @@ begin
       dtInt64 : Result := AsInt64;
       {$IFNDEF FPC}
       dtVariant : Result := TValue.FromVariant(AsVariant);
+      dtInterface : Result := TValue.FromVariant(AsInterface);
       {$ENDIF}
       dtObject : Result := AsObject;
-      dtInterface : Result := TValue.FromVariant(AsInterface);
       dtArray : Result := (Self.Data as IValueTValue).Value;
       else raise Exception.Create('DataType not supported');
     end;
@@ -122,9 +122,9 @@ begin
     tkSet : AsInteger := Value.AsInteger;
     tkClass : AsObject := Value.AsObject;
     tkInterface : AsInterface := Value.AsInterface;
+    {$IFNDEF FPC}
     tkArray,
     tkDynArray : Self.SetAsCustom(TValueTValue.Create(Value),TValueDataType.dtArray);
-    {$IFNDEF FPC}
     else AsVariant := Value.AsVariant;
     {$ENDIF}
   end;

+ 4 - 0
Quick.Value.pas

@@ -244,7 +244,9 @@ type
     property Data : TValueData read fDataIntf;
     {$ENDIF}
     property DataType : TValueDataType read fDataType;
+    {$IFNDEF FPC}
     procedure SetAsCustom(aData : IInterface; aType : TValueDataType);
+    {$ENDIF}
     property AsString : string read CastToString write SetAsString;
     {$IFDEF MSWINDOWS}
     property AsAnsiString : AnsiString read CastToAnsiString write SetAsAnsiString;
@@ -978,11 +980,13 @@ begin
   fDataType := TValueDataType.dtClass;
 end;
 
+{$IFNDEF FPC}
 procedure TFlexValue.SetAsCustom(aData: IInterface; aType: TValueDataType);
 begin
   fDataIntf := aData;
   fDataType := aType;
 end;
+{$ENDIF}
 
 procedure TFlexValue.SetAsDateTime(const Value: TDateTime);
 begin