Delphi is heavily bound to Windows. Because of this, it has introduces a lot of Windows-isms in
the API (e.g. le searching and opening, loading libraries).
Free Pascal was designed to be portable, so things that are very Windows speci c are missing,
although the Free Pascal team tries to minimize this. The following are the main points that
should be considered:
- By default, Free Pascal generates console applications. This means that you must explicitly
enable the GUI application type for windows:
- The Windows unit provides access to most of the core Win32 API. Some calls may have
di erent parameter lists: instead of declaring a parameter as passed by reference (var), a
pointer is used (as in C). For most cases, Free Pascal provides overloaded versions of such
calls.
- Widestrings. Widestring management is not automatic in Free Pascal, since various
platforms have di erent ways of dealing with widestring encodings and Multi-Byte
Character Sets. FPC supports Widestrings, but may not use the same encoding as on
Windows.
- Threads: At this moment, Free Pascal does not o er native thread management on all
platforms; on Unix, linking to the C library is needed to provide thread management in an
FPC application. This means that a cthreads unit must be included to enable
threads.
- a much-quoted example is the SetLastOSError call. This is not supported, and will never be
supported.
- Filename Case sensitivity: Pascal is a case-insensitive language, so the uses clause
should also be case insensitive. Free Pascal ensures case insensitive lenames by also
searching for a lowercase version of the le. Kylix does not do this, so this could
create problems if 2 di erently cased versions of the same lename are in the
path.
- RTTI is NOT stored in the same way as for Delphi. The format is mostly compatible, but
may di er. This should not be a problem if the API of the TypeInfo unit is used and no
direct access to the RTTI information is attempted.
- Sets are of di erent size than in Delphi.
- Enumerateds are of di erent size than in Delphi.
- In general, one should not make assumptions about the internal structure of complex types
such as records, objects, classes and their associated structure: For example the
VMT table layout is di erent, the alignment of elds in a record may be di erent,
etc.
- The same is true for basic types: on other processors the high and low bytes of a word or
integer may not be on the same location as on an Intel processor (the endianness is
di erent).
typo
"Free Pascal does not other native thread management on all platforms" should be "Free Pascal does not offer native thread management on all platforms"-- Unregistered Visitor on February 14, 2007 03:44 PM (view details)