version check of Freepascal

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
Stilgar
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 29.03.2011, 10:38

version check of Freepascal

Post by Stilgar »

For freepascal version recognition trouble, try to integrate in zeos.inc this code.
I've used it in lastest version lazarus installation package.
See youFreepascal version check

Code: Select all

{$IFDEF FPC}
  {$MODE DELPHI}
  {$INTERFACES COM}
  {$DEFINE VER140BELOW}
  // We assume 2 levels is sufficient.
  // The higher the third number in a version, the better... (we hope)
  {$IFDEF fpc_version>=5}
    {$MESSAGE 'FPC2_5UP'}
    {$DEFINE FPC2_5UP}
  {$ENDIF}
  {$IFDEF fpc_version>=4}
    {$MESSAGE 'FPC2_4UP'}
    {$DEFINE FPC2_4UP}
  {$ENDIF}
  {$IFDEF fpc_version>=3}
    {$MESSAGE 'FPC2_3UP'}
    {$DEFINE FPC2_3UP}
  {$ENDIF}

  {$IFDEF fpc_version>=2}
    {$MESSAGE 'FPC2_2UP'}
    {$DEFINE FPC2_2UP}
  {$ENDIF}

  {$IFDEF fpc_version>=1}
    {$MESSAGE 'FPC2_1UP'}
    {$DEFINE FPC2_1UP}
  {$ENDIF}

  {$IFDEF VER2}
    {$MESSAGE 'FPC2_UP'}
    {$DEFINE FPC2_UP}
  {$ENDIF}
{$ENDIF}

User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Stilgar,

For which branch is that proposal made? Latest version: http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing

Is this patch for 6.6.6?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Stilgar
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 29.03.2011, 10:38

Post by Stilgar »

Hi EgonHugeist,
this piece of code is for Zeos7.0. (I've change on this version)
I don't if we can call patch.... is so stupid change ... ;)
The 6.6.6 is from long time i don't touch it. I've read that the 7 beta version is only for possible issues with delphi. Isn't so?
PS: now active the replay notification. Sorry for my reply latency
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Stilgar,

ok stilgar. The actual version check we have was a patch from MarcoV (FPC-Core) so i will point him to your proposal and let him decide which way is better. Can you tell me the advantages? Was somthing wrong?

Yeah Zeos7 has only the Alpha atribute because of the Delphi2009 combat. But this is solved now too. Beta is comming soon.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Stilgar
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 29.03.2011, 10:38

Post by Stilgar »

In few words, PFC 2.6.0 and LCL introduces some new classes and other stuff for enforce the compatibility with delphi. So some code is obsolete or wrong due these changes.
With more precision in the version checking, my lazarus 1.0 and fpc 2.6.0 is able to compile with out errors.
Bye
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Post by marcov »

I'm totally against this.

The principle of the current codebase (after my mods) is that compiler versions should never be used directly in the code. The new branches should reflect this already for the more core units. (HAVE_XX and WITH_x instead of ver<x>)

The usage with compiler and version checking directly in the sourcecode lead to the mess with 6.6.6 breaking with 2.6.0 needlessly, and that should not be repeated.

Anyways, the "UP" system is from the old days before ways to check version directly, which are versions of Delphi and FPC which are not supported anymore. All current versions support $IF for version systems, and this way of working doesn't make sense anymore.

Anything before 2.4.0 is unsupported. (and that only because some older revisions of popular Linux distros still package that version, 2.6.0 is the norm, with some older users on 2.4.4 versions)

Versions with odd last number are development versions. There is no single FPC 2.5.x, it is a working title that spans nearly 3 years of development, and the whole spectrum of changes between half an year before 2.4.0 and the moment of release 2.6.0.

So only the last odd versions are 2.7. (trunk branch) and the same for the fixes branch (2.6.1) and these versions reflect the current state of the day.

If you have specific problems with FPC related versioning in the Zeos-testing codebase, report them, and I'll fix them.
Last edited by marcov on 20.09.2012, 12:52, edited 1 time in total.
Stilgar
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 29.03.2011, 10:38

Post by Stilgar »

As you want. Sorry.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Stilgar,

Each proposal/patch is better then nothing or bad critics. Don't worry about. But i agree with Marco. It is much better to code/maintain with Property-Based defines. He did a great job there.

Thank you..

marcov,

I had not the time to write you. Thank you for answering this post.
I have a question list for you again. If i have it ready then i'll mail you.

Thank you too, Marco.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Locked