#1 2018-07-25 11:25:41

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Anyone managed to compile latest build with D2009...?

Hello everyone,

Downloaded the latest build (25 Jul 2018 this morning)
and came across an error that appears during compilation
and just cant' figure out...

The error msg when compiling with Delphi 2009
is 'incompatible types ' and it appears in the file Mormot.pas:

function TIPBan.Add(const aIP: RawUTF8): boolean;
var ip4: cardinal;
begin
  result := false;
  if (self=nil) or not IPToCardinal(aIP,ip4) then
    exit;
  fSafe.Lock; // ERROR here at compilation: gives' incompatible types'

I wonder what is happening at compilation,
(do know that D2009 is buggy with respect to NativeUInt which
can usually be avoided by changing the type to Cardinal or NativeInt).

Would really appreciate any comments here as am stuck with Delphi 20009 :-)

Kind regards,
Sami

Offline

#2 2018-07-25 13:55:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Anyone managed to compile latest build with D2009...?

Normally there is this code in SynCommons.pas

{$ifdef ISDELPHI2009}
  PtrUInt = cardinal; { see https://synopse.info/forum/viewtopic.php?id=136 }

Then later on, we rely on this PtrUInt definition, and never use NativeUInt.

Or did I miss something?

Are you sure you don't have an old Synopse.inc file somewhere in your path?

Offline

#3 2018-07-26 09:33:11

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: Anyone managed to compile latest build with D2009...?

Thanks for this hint, ab. Made sure that the correct synopse.inc
was being used (renamed the file to synopsenew.inc, changing all inc.references in the *.pas files accordingly).

However, compilation still stops at the file SynZip.pas
due to the following declaration.

Var
    PDataStart: ZipPtrUint;

Am definitely using D2009, (checked that constant CompilerVersion does return 20)
so this is really puzzling...seems as if the D2009 directives are having no effect..?

Offline

#4 2018-07-26 10:38:58

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Anyone managed to compile latest build with D2009...?

Offline

#5 2018-07-26 13:40:52

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: Anyone managed to compile latest build with D2009...?

Hello,

Thank you, just tried it, it got me at least one step forward: the error in file SynZap.pas is now gone,
what remains is:
the  'incompatible types' which stubbornly still appears in  file Mormot.pas:

function TIPBan.Add(const aIP: RawUTF8): boolean;
var ip4: cardinal;
begin
  result := false;
  if (self=nil) or not IPToCardinal(aIP,ip4) then
    exit;
  fSafe.Lock; // ERROR here at compilation: gives' incompatible types'

Offline

Board footer

Powered by FluxBB