[Lazarus] Determining Laz/fpc version without using LCLVersion

Sven Barth pascaldragon at googlemail.com
Tue Jan 13 22:47:38 CET 2015


Am 13.01.2015 19:56 schrieb "Werner Pamler" <werner.pamler at freenet.de>:
>
> > In practice, I make no attempt to go earlier than FPC 2.2.4 (there are
> > reasons for avoiding earlier compilers that do not need discussion)
> > together with Lazarus 0.9.24 (fixes_0_9_24 from svn), which is about the
> > earliest that has LCLVersion.
>
> This is much more than what I want, I think I'll stop with Laz1.0/FPC
2.4.0. I see now that I can get the basic spreadsheet functionality to work
fine with these versions, but the visual controls and demos are rather
fragile - this shows the enormous progress the LCL has made since summer
2012.
>
> Currently, I avoid using LCLVersion by having some conditional defines
which have to be activated in order to compile with old versions, and in
the wiki page there is some documentation of these defines. It's not
perfect, but provides at least a way to go.

Maybe you can use two units for compatibility: one (e.g. FPCFixes) for the
non visual parts that solely relies on FPC provided functionality. There
you can use FPC_VERSION and friends to determine the compiler. The other
unit (e.g. LazFixes) is only used for the visual components and thus can
use LazVersion without problems.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150113/34f253a2/attachment-0003.html>


More information about the Lazarus mailing list