[fpc-devel] Sending a patch

Alexsander Rosa alexsander.rosa at gmail.com
Fri Mar 17 16:00:14 CET 2006

What's the procedure for sending a patch? There are a few Delphi
functions I would like to add to FPC, like "StrToDateDef" and
"RoundTo". It seems the first must be added to
objpas/sysutils/dati.inc (probable close to StrToDate, at line 306);
I'm not sure about the second one.

I saw also that BoolToStr is different. In Delphi it is:

//--- Delphi's BoolToStr
function BoolToStr(B: Boolean; UseBoolStrs: Boolean = False): string;

If UseBoolStrs is false (the default), it returns '-1' for true and
'0' for false. If UseBoolStrs is true, it returns the strings 'TRUE'
and 'FALSE'. In Free Pascal there are 2 functions:

//--- in objpas/sysutils/sysstr.inc
function BoolToStr(B: Boolean): string;
  If B then

//--- in ide/wutils
function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
  if B then BoolToStr:=TrueS else BoolToStr:=FalseS;

So a call to BoolStr(true) would return '-1' in Delphi and 'TRUE' in
FPC. I don't know if it was pointed before, and I agree that returning
'TRUE' makes a lot of sense, but when porting an application this may
lead to trouble.

About me: I code since 1989 (C/C++) and have been using Delphi since
1997 (I started in version 3.0). At the moment I'm porting a 150+ kloc
Delphi project to Lazarus.


Alexsander da Rosa

More information about the fpc-devel mailing list