[fpc-devel]To make more Delphi compatibility!

Pavel V. Ozerski pavel at insect.mail.iephb.ru
Wed Mar 14 12:38:26 CET 2001


Hello,
I reported yesterday to developers mailing list my problems which I got while my attempt to
port KOL (Key Objects Library, http://kol.nm.ru) to FPC.
Some of these problems I tried to solve using compiler patching. This patch I would to send to you;
maybe, they are not useless.

I could fix only two Delphi incompatibilities now.
1) Delphi supports properties in BP-style objects. May be, this feature is not well-known but it is used in KOL.
2) If property index value is outside integer range but formal index type in procedure is integer, Delphi compiles
source successfully but FPC fails.


All my fixes are two lines in pdecobj.pas.

      procedure property_dec;

        var
           sym : psym;
           propertyparas : tlinkedlist;

        { returns the matching procedure to access a property }
        function get_procdef : pprocdef;

          var
             p : pprocdef;

          begin
             p:=pprocsym(sym)^.definition;
             get_procdef:=nil;
             while assigned(p) do
               begin
                  if convertable_paras(p^.para,propertyparas,cp_value_equal_const) then{**Ozerski 14.03.01, instead equal_paras}
                    break;
                  p:=p^.nextoverloaded;
               end;
             get_procdef:=p;
          end;

        var
           hp2,datacoll : tparaitem;
           p : ppropertysym;
           overriden : psym;
           hs : string;
           varspez : tvarspez;
           sc : tidstringlist;
           s : string;
           tt : ttype;
           declarepos : tfileposinfo;
           pp : pprocdef;
           pt : tnode;
           propname : stringid;

        begin
           { check for a class }
           if not((is_class_or_interface(aktclass))or((m_delphi in aktmodeswitches)and(is_object(aktclass))))then{**Ozerski 14.03.01, new condition added}
            Message(parser_e_syntax_error);
...........................

Sincerely, Pavel








More information about the fpc-devel mailing list