From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2cb1f0b6d642e1dc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!postnews.google.com!o30g2000pra.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Pascal Calling Convention Date: Wed, 23 Mar 2011 19:23:39 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <9b04626e-567d-408c-aab3-39b964b3ffd6@l2g2000prg.googlegroups.com> <6e021ff9-17ec-430b-a4ec-8f4ae5b40ac7@w9g2000prg.googlegroups.com> NNTP-Posting-Host: 174.28.187.243 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1300933419 2367 127.0.0.1 (24 Mar 2011 02:23:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 24 Mar 2011 02:23:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o30g2000pra.googlegroups.com; posting-host=174.28.187.243; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 ( .NET CLR 3.5.30729; .NET4.0E),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:18415 Date: 2011-03-23T19:23:39-07:00 List-Id: On Mar 23, 6:38=A0pm, ytomino wrote: > Hello, > > On Mar 24, 6:37=A0am, Shark8 wrote: > > > I was looking around for a way to use the Pascal calling convention in > > GNAT; particularly because I thought it might be nice to do the GUI- > > stuff in good old Delphi 5 and the application itself in Ada. All > > easily doable via DLL or, possibly, through the $L compiler directive > > which specifies a .obj file to link to. > > In the first, Delphi's default calling convertion is "register" (=3D > fastcall), > not pascal. And, GNAT does not support fastcall, > moreever fastcall of gcc is different than fastcall of Windows. > Probably you have to change calling convertion in Delphi-side. > > http://docwiki.embarcadero.com/RADStudio/XE/en/Procedures_and_Functio... Yep, I know that it's not the default. But it *does* have Pascal calling convention capability. And, to be honest, I *don't want* variable parameters passed in the OS; so, as someone observed, if the right-to-left parameter passing is the only way for it to be handled then designing the OS in such a way so as to preclude even that possibility sounds like a good idea to me. {Like Null-exclusion or subranges; I can design out possible errors/ complexities.} > > -- I found a utility to convert between .o and .obj; so that's not a > > problem. Though if someone knows a way to > > -- have GNAT emit .obj files instead of .o I'd like to hear it. > > That sounds good! > How it work about gcc-runtime? (memomry manager, exception handling, > etc) I'm not sure. I haven't "played around" with it enough yet.