[fpc-pascal] Free Pascal bindings for EyeLink C code (with a god-cast)

Tomas Hajny xhajt03 at hajny.biz
Wed Jun 14 22:27:02 CEST 2023


On 14 June 2023 20:59:41 +0200, "Rafael Picanço via fpc-pascal" <fpc-pascal at lists.freepascal.org> wrote:


Hi Rafael,

>I am trying to follow your advice and use units instead:
>
>const
>  EXTERNAL_DEV_NONE : TGetExButtonStatesFunction = Pointer(0);
>
>However I am receiving an error:
>
>Error: Incompatible types: got "Pointer" expected "<procedure variable type
>of function(PCCDBS):LongInt;CDecl>"
>
>Please, can you shed some light on this?

I can't test it right now, but I believe that 

const
  EXTERNAL_DEV_NONE : TGetExButtonStatesFunction =
                                                                               TGetExButtonStatesFunction (Pointer(0));

(i.e. with an explicit typecast to the required type) should work.

Tomas



More information about the fpc-pascal mailing list