[fpc-pascal] Gecko / Firefox / XPCOM

Henrik Genssen henrik.genssen at mediafactory.de
Sun May 24 14:11:11 CEST 2009


>> (...)
>> nsMemory.pas(155,13) Warning: Some fields coming before "GetMem" weren't initialized
>> nsMemory.pas(157,17) Warning: Some fields coming before "ReallocMem" weren't initialized
>> nsMemory.pas(157,17) Error: Incompatible types: got "Realloc(Pointer, LongInt):^untyped" expected "<procedure variable type of function(var Pointer, LongInt):^untyped;Register>"
>> nsMemory.pas(165) Fatal: There were 1 errors compiling module, stopping
>>
>> for the following costruct - stopping at the line ReallocMem:
>>
>> const
>>  memmgr: TMemoryManager = (
>>    GetMem: Alloc;
>>    FreeMem: Free;
>>    ReallocMem: Realloc;
>>  );
>> procedure SetToMemoryManager;
>> begin
>>  SetMemoryManager(memmgr);
>> end;
>You must either set Delphi compiler mode - {$mode Delphi} - or get a
>reference/pointer to the functions Alloc, Free and Realloc (prefix
>them with the @ operator).
I have already set the compilermode to Delphi - any other idea?

>BTW, it looks like you're accessing the TMemoryManager declaration
>from System.pp/SysInit (? heaph.inc), is it what you intended?
in Delphi system.pas is used:

  PMemoryManager = ^TMemoryManager;
  TMemoryManager = record
    GetMem: function(Size: Integer): Pointer;
    FreeMem: function(P: Pointer): Integer;
    ReallocMem: function(P: Pointer; Size: Integer): Pointer;
  end;

what shell I use with FPC?

regards

Hinnack



More information about the fpc-pascal mailing list