On Thu, 4 Oct 2007 19:58:08 +0200 (CEST) Michael Van Canneyt <[EMAIL PROTECTED]> 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 _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal