[Lazarus] Codetools question

Ondrej Pokorny lazarus at kluug.net
Sat Oct 10 12:39:28 CEST 2015


On 10.10.2015 12:35, Michael Van Canneyt wrote:
>
> Hi,
>
> Mainly for Mattias, I suppose:
>
> The SetString routine in the system unit has become a compiler 
> procedure in 3.0:
>
> {$ifdef FPC_HAS_CPSTRING}
> Procedure fpc_setstring_ansistr_pansichar(out S : RawByteString; Buf : 
> PAnsiChar; Len : SizeInt; cp: TSystemCodePage); rtlproc; compilerproc;
> {$else}
> Procedure SetString(out S : AnsiString; Buf : PAnsiChar; Len : SizeInt);
> {$endif}
> begin
>   SetLength(S,Len);
> {$ifdef FPC_HAS_CPSTRING}
>   SetCodePage(S,cp,false);
> {$endif}
>   If (Buf<>Nil) then
>     fpc_pchar_ansistr_intern_charmove(Buf,0,S,0,Len);
> end;
>
> This means the codetools are no longer able to find the SetString 
> declaration.
>
> Is there any way to fix this kind of things (i.e. find compiler procs) 
> in the code tools ?

Yes, see TIdentCompletionTool.GatherPredefinedIdentifiers() in 
IdentCompletionTool.pas

Add this line there:

     AddCompilerProcedure('SetString','out 
S:RawByteString;Buf:PAnsiChar;Len:SizeInt;cp:TSystemCodePage');

Ondrej




More information about the Lazarus mailing list