Browse Source

Fix targets without AnsiString feature
by removal of ClassNameIs overload with RTLString
type because RTLString=ShortString when
the target does not support AnsiString.

Pierre Muller 1 week ago
parent
commit
a5ef9e946c
2 changed files with 6 additions and 1 deletions
  1. 3 0
      rtl/inc/objpas.inc
  2. 3 1
      rtl/inc/objpash.inc

+ 3 - 0
rtl/inc/objpas.inc

@@ -752,6 +752,8 @@ end;
       begin
         ClassNameIs:=ShortCompareText(PVmt(Self)^.vClassName^, name) = 0;      
       end;
+
+      {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
       class function TObject.ClassNameIs(const name : RTLString) : boolean;
 
         var
@@ -765,6 +767,7 @@ end;
            {$ENDIF}
            ClassNameIs:=ClassNameIs(SS);
         end;
+      {$endif FPC_HAS_FEATURE_ANSISTRINGS}
 
       class function TObject.InheritsFrom(aclass : TClass) : Boolean;
 

+ 3 - 1
rtl/inc/objpash.inc

@@ -274,7 +274,9 @@
           {$IF SIZEOF(CHAR)=2}
           class function ClassNameIs(const name : AnsiString) : boolean; overload; {$ifdef SYSTEMINLINE}inline;{$endif}
           {$ENDIF}
-          class function ClassNameIs(const name : RTLString) : boolean; overload;  {$ifdef SYSTEMINLINE}inline;{$endif}
+          {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
+	  class function ClassNameIs(const name : RTLString) : boolean; overload;  {$ifdef SYSTEMINLINE}inline;{$endif}
+          {$endif FPC_HAS_FEATURE_ANSISTRINGS}
           class function ClassNameIs(const name : ShortString) : boolean; 
           class function ClassParent : tclass;{$ifdef SYSTEMINLINE}inline;{$endif}
           class function InstanceSize : SizeInt;// {$ifdef SYSTEMINLINE}inline;{$endif}