Explorar o código

[flexValue] fixed fpc compatibility

Exilon %!s(int64=5) %!d(string=hai) anos
pai
achega
a8c5f6817d
Modificáronse 2 ficheiros con 6 adicións e 2 borrados
  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