uberto at gama-soft.com
uberto at gama-soft.com
Tue Feb 1 08:24:10 CET 2005
I'm going to port IO (www.instantobjects.org) to fpc.
The codebase is quite large (about 30000 lines of code) and I don't really
know fpc, but I hope I'll understand it better at the end of the story. ;)
I'm in touch with IO main developers so there's no problem to slightly change
IO code for compatibility.
I tried first to compile it commenting problematic parts, all in all there
are very few problems.
I'm not sure fpc attitude to Delphi compatibility, also regarding IP
problems. So I list here what I found, please tell me what I can submit as
bug, and what is yet differently implemented (or intended to be so).
I tested with a Lazarus build 0.9.4 (3/1/05) under win32, maybe it'd be
better testing with fpc only and a cvs version but I was interested in it as
a proof of concept.
1 - delphi has TRecStringRec and PRecStringRec, used by (among others)
Exception.CreateRes(); fpc has PString that is different.
2 - delphi allows for a resourcestring to be passed by address
(@MyResourceString), fpc don't.
1 - curiously fpc TCollection hasn't a remove or delete method, delphi
TCollection has it. [maybe I did't find it]
1 - delphi TFiler has an internal Stream, TReader and TWriter use it and
expose Position, Read, Write and other methods that use it; fpc TFiler
hasn't. [in this case maybe fpc has the right approach btw]
2 - delphi has TWriter.WriteStr (which is different from WriteString that use
AnsiString), same with TReader.ReadStr; fpc hasn't.
3 - delphi TStream has a FlushBuffer method; fpc hasn't. [which is curious
and potentially slower]
4 - delphi TReader.ReadChar/TWriter.WriteChar use a char (1 byte); fpc use a
string (6 byte at least).
1 - delphi TPropInfo.PropType is PPTypeInfo; fpc TPropInfo.PropType is
PTypeInfo (a direct pointer instead of a pointer of pointer). [Are there
1 - fpc lacks VarClear() function. [It exists but it's not public]
1 - fpc lacks a TCustomConnection abstract class. [Delphi TCustomConnection
is not really abstract but it doesn't do anything anyway]
2 - fcp TDataset lacks locate method. [I don't checked for an equivalent]
3 - Delphi TFieldDefs.Update is a boolean property; fpc TFieldDefs.Update is
a procedure.[Trivial to fix anyway]
1 - fpc lacks a HexToBin and BinToHex functions. [It has them but only as
private methods of TParser]
2 - TStringListSortCompare function type differs. [Trivial to fix]
1 - I think fpc lacks run-time packages support. [If I'm mistaken I have to
study it better. Anyway it's not a real problem]
As you can see there's nothing really serious, I can contribute code if you
I hope IO will be useful to fpc and lazarus projects.
More information about the fpc-devel