[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: portable cdecl 'elliptic' function calls

From: Fergus Henderson
Subject: [Axiom-developer] Re: portable cdecl 'elliptic' function calls
Date: Tue, 29 Jul 2003 11:29:27 +1000
User-agent: Mutt/1.3.28i

On 28-Jul-2003, Camm Maguire <address@hidden> wrote:
> object
> c_apply_n(object (*fn)(), int n, object *x)
> {object res=Cnil;
> #if 1
>  object *stack;
>  if (!(stack=alloca(n*sizeof(*stack))))
>    FEerror("Cannot allocate stack for elliptic call", 0);
>  memcpy(stack,x,n*sizeof(*stack));
>  res=fn();

This code is extremely non-portable.

I suggest you try using libffi, which is included in the GCC sources.
See libffi/README.

Fergus Henderson <address@hidden>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]