Skip to content

Sugestão para viabilizar o uso de procedure anônima no método Listen (com FPC)  #361

@edsontmarques

Description

@edsontmarques

Similar ao que já se encontra na unit Horse.Callback, sugeriria avaliar a possibilidade de alterar a Horse.Proc da seguinte forma:

unit Horse.Proc;

{$IF DEFINED(FPC)}
  {$MODE DELPHI}{$H+}
  {$IF DEFINED(HORSE_FPC_FUNCTIONREFERENCES)}
    {$MODESWITCH FUNCTIONREFERENCES+}
  {$ENDIF}
{$ENDIF}

interface

{$IF NOT DEFINED(FPC)}
uses
  System.SysUtils;
{$ENDIF}

type
  TNextProc = {$IF DEFINED(FPC)}procedure of object{$ELSE}System.SysUtils.TProc{$ENDIF};
  TProc = {$IF DEFINED(FPC)}{$IF DEFINED(HORSE_FPC_FUNCTIONREFERENCES)}reference to {$ENDIF}procedure{$ELSE}System.SysUtils.TProc{$ENDIF};

  {$IF DEFINED(FPC)}
    TProc<T> = {$IF DEFINED(HORSE_FPC_FUNCTIONREFERENCES)}reference to {$ENDIF}procedure(Arg1: T);
  {$ENDIF}

implementation

end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions