synopse / mORMot

Synopse mORMot 1 ORM/SOA/MVC framework - Please upgrade to mORMot 2 !
https://synopse.info
785 stars 323 forks source link

64 bit Mustache SynCommons compiler error #409

Closed hafedh-trimeche closed 2 years ago

hafedh-trimeche commented 2 years ago

this declaration generated error:

  THeapMemoryStream = class(TMemoryStream)
  protected
    function Realloc(var NewCapacity: longint): Pointer; override;
  end;

[dcc64 Error] SynCommons.pas(13427): E2037 Declaration of 'Realloc' differs from previous declaration longint vs NativeInt. It should be declared as:

THeapMemoryStream = class(TMemoryStream)
  protected
    function Realloc(var NewCapacity: NativeInt): Pointer; override;
  end;
synopse commented 2 years ago

Your source code is clearly outdated.

Here is how it is currently defined:

  {$ifdef FPC} // FPC already use heap instead of GlobalAlloc()
  THeapMemoryStream = TMemoryStream;
  {$else}
  {$ifndef UNICODE} // old Delphi used GlobalAlloc()
  THeapMemoryStream = class(TMemoryStream)
  protected
    function Realloc(var NewCapacity: longint): Pointer; override;
  end;
  {$else}
  THeapMemoryStream = TMemoryStream;
  {$endif}
  {$endif}    

Which compiles fine.

Please use the forum before creating a ticket in github.