[fpc-pascal] function alias
Mattias Gaertner
nc-gaertnma at netcologne.de
Thu Oct 4 20:09:45 CEST 2007
On Thu, 4 Oct 2007 19:58:08 +0200 (CEST)
Michael Van Canneyt <michael at freepascal.org> wrote:
>
>
> On Thu, 4 Oct 2007, Mattias Gaertner wrote:
>
> > How can I create an alias for a function?
> > For example:
> >
> > procedure DoSomething(...params...); cdecl; external 'useful';
> >
> > const
> > DoAliasSomething = DoSomething;
> >
> > fpc does not allow this. So how can it be done?
>
> program test;
>
> procedure something; external name 'something';
>
> Type
> TProcedure = Procedure;
>
> const
> DoSomething : TProcedure = @something;
>
> begin
> end.
>
> Works fine.
Yes, but I hoped to declare it in situ - without adding another type. ;)
The reason is that I'm auto translating some C headers that contains
aliases for functions.
Mattias
More information about the fpc-pascal
mailing list