Przeglądaj źródła

* Merging revisions r43482 from trunk:
------------------------------------------------------------------------
r43482 | michael | 2019-11-15 17:57:13 +0100 (Fri, 15 Nov 2019) | 1 line

* Fix compilation with 3.0.4
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@43752 -

michael 5 lat temu
rodzic
commit
bc1966c1dc
1 zmienionych plików z 7 dodań i 2 usunięć
  1. 7 2
      rtl/objpas/fgl.pp

+ 7 - 2
rtl/objpas/fgl.pp

@@ -142,6 +142,7 @@ type
     Type
     Type
       TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
       TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
     constructor Create;
     constructor Create;
+
     class Function ItemIsManaged : Boolean; override;
     class Function ItemIsManaged : Boolean; override;
     function Add(const Item: T): Integer; {$ifdef FGLINLINE} inline; {$endif}
     function Add(const Item: T): Integer; {$ifdef FGLINLINE} inline; {$endif}
     function Extract(const Item: T): T; {$ifdef FGLINLINE} inline; {$endif}
     function Extract(const Item: T): T; {$ifdef FGLINLINE} inline; {$endif}
@@ -968,7 +969,11 @@ end;
 
 
 class function TFPGList.ItemIsManaged: Boolean;
 class function TFPGList.ItemIsManaged: Boolean;
 begin
 begin
+{$IFNDEF VER3_0}
   Result:=IsManagedType(T);
   Result:=IsManagedType(T);
+{$ELSE}
+  Result:=True; // Fallback to old behaviour  
+{$ENDIF}
 end;
 end;
 
 
 function TFPGList.GetEnumerator: TFPGListEnumeratorSpec;
 function TFPGList.GetEnumerator: TFPGListEnumeratorSpec;
@@ -1011,7 +1016,7 @@ var
   i: Integer;
   i: Integer;
   
   
 begin
 begin
-  if IsManagedType(T) then
+  if ItemIsManaged then
     begin
     begin
     Capacity:=Capacity+Source.Count;
     Capacity:=Capacity+Source.Count;
     for I := 0 to Source.Count - 1 do
     for I := 0 to Source.Count - 1 do
@@ -1023,7 +1028,7 @@ end;
 
 
 procedure TFPGList.Assign(Source: TFPGList);
 procedure TFPGList.Assign(Source: TFPGList);
 begin
 begin
-  if IsManagedType(T) then
+  if ItemIsManaged then
     begin
     begin
     Clear;
     Clear;
     AddList(Source);
     AddList(Source);