public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Camm Maguire <camm@enhanced.com>
To: Fergus Henderson <fjh@cs.mu.OZ.AU>
Cc: gcc@gcc.gnu.org,  gcl-devel@gnu.org,  axiom-developer@nongnu.org,
	<acl2@lists.cc.utexas.edu>, <maxima@mail.ma.utexas.edu>
Subject: Re: portable cdecl 'elliptic' function calls
Date: Thu, 31 Jul 2003 02:40:00 -0000	[thread overview]
Message-ID: <54vftj1xzl.fsf@intech19.enhanced.com> (raw)
In-Reply-To: <20030729012927.GA24209@ceres.cs.mu.oz.au>

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 <fjh@cs.mu.OZ.AU> writes:

> On 28-Jul-2003, Camm Maguire <camm@enhanced.com> 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 <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
> The University of Melbourne         |  of excellence is a lethal habit"
> WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- 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

  reply	other threads:[~2003-07-30 21:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-28 22:48 Camm Maguire
2003-07-29  9:52 ` Fergus Henderson
2003-07-31  2:40   ` Camm Maguire [this message]
2003-07-31  6:42     ` [Gcl-devel] " Mike Thomas
2003-07-31 14:53       ` Fergus Henderson
2003-08-01  1:22       ` Tom Tromey
2003-08-01  2:29         ` Tom Tromey
2003-07-29 11:37 ` [Axiom-developer] " Arthur Norman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54vftj1xzl.fsf@intech19.enhanced.com \
    --to=camm@enhanced.com \
    --cc=acl2@lists.cc.utexas.edu \
    --cc=axiom-developer@nongnu.org \
    --cc=fjh@cs.mu.OZ.AU \
    --cc=gcc@gcc.gnu.org \
    --cc=gcl-devel@gnu.org \
    --cc=maxima@mail.ma.utexas.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).