From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11087 invoked by alias); 30 Jul 2003 21:55:10 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 11075 invoked from network); 30 Jul 2003 21:55:08 -0000 Received: from unknown (HELO intech19.enhanced.com) (66.134.96.17) by sources.redhat.com with SMTP; 30 Jul 2003 21:55:08 -0000 Received: from camm by intech19.enhanced.com with local (Exim 3.35 #1 (Debian)) id 19hyuP-0007Ng-00; Wed, 30 Jul 2003 17:54:57 -0400 To: Fergus Henderson Cc: gcc@gcc.gnu.org, gcl-devel@gnu.org, axiom-developer@nongnu.org, , Subject: Re: portable cdecl 'elliptic' function calls References: <20030729012927.GA24209@ceres.cs.mu.oz.au> From: Camm Maguire Date: Thu, 31 Jul 2003 02:40:00 -0000 In-Reply-To: <20030729012927.GA24209@ceres.cs.mu.oz.au> Message-ID: <54vftj1xzl.fsf@intech19.enhanced.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-07/txt/msg02269.txt.bz2 Greetings, and thank you for this tip! I now think I see how to do this in GCL, and would like to build in dependency on libffi. Is this available on everyone's systems? I'm assuming its packaged at least everywhere gcc is available. What about solaris, Mac OS X? Take care, Fergus Henderson writes: > On 28-Jul-2003, Camm Maguire 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 | "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. > > > -- Camm Maguire camm@enhanced.com ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah