You are not logged in.
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
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
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
Please check https://synopse.info/fossil/info/a9332bde73
Offline
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