I am porting a Delphi code which runs fine on Delphi mode, but what the correspondent way on ObjectFP mode?
The code is:
function StrLComp(const S1, S2: PChar; MaxLen: Integer): Integer;
begin
Result := SysUtils.StrLComp(S1, S2, MaxLen);
end;
var
Compare: function(const S1, S2: PChar; MaxLen: Integer): Integer;
begin
@Compare := @StrLComp; // now compiler refuses compilation with the message "Can't assign to an adress", but it runs OK on Delphi mode
end;