[fpc-devel] Interface: Method resolution clauses

Sergei Gorelkin sergei_gorelkin at mail.ru
Mon Apr 30 20:23:41 CEST 2012


30.04.2012 20:38, Marcos Douglas пишет:
>
> Simple. Does not compile.
>
The following compiles successfully (in Win32):

---------------------------------------------- cut
{$mode objfpc}{$h+}
uses activex;

type
   TMemoryManager = class(TInterfacedObject, IMalloc)
      function IMalloc.Alloc = Allocate;
      procedure IMalloc.Free = Deallocate;
      function IMalloc.Realloc = Reallocate;
      function IMalloc.GetSize = get_size;
      function IMalloc.DidAlloc = did_alloc;
      procedure IMalloc.HeapMinimize = heap_minimize;

      function allocate(sz: longword): pointer; stdcall;
      procedure deallocate(p: pointer); stdcall;
      function reallocate(p: pointer; sz: longword): pointer; stdcall;
      function get_size(p: pointer): longword; stdcall;
      function did_alloc(p: pointer): longint; stdcall;
      procedure heap_minimize; stdcall;
   end;

function TMemoryManager.allocate(sz: longword): pointer; stdcall;
begin
end;

procedure TMemoryManager.deallocate(p: pointer); stdcall;
begin
end;

function TMemoryManager.reallocate(p: pointer; sz: longword): pointer; stdcall;
begin
end;

function TMemoryManager.get_size(p: pointer): longword; stdcall;
begin
end;

function TMemoryManager.did_alloc(p: pointer): longint; stdcall;
begin
end;

procedure TMemoryManager.heap_minimize; stdcall;
begin
end;

begin
end.
------------------------------------------- cut

Sergei



More information about the fpc-devel mailing list