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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,9302958eecfda77 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-09 09:55:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Binding to functions having reference parameter Date: 08 May 2002 11:19:10 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: skates.gsfc.nasa.gov 1020871544 12622 128.183.220.71 (8 May 2002 15:25:44 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 8 May 2002 15:25:44 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:23786 Date: 2002-05-08T15:25:44+00:00 List-Id: "Antonio L�pez" writes: > I am doing a binding to a Dll Using Win32 binding and I have a problem with > functions having reference parameters (an C array). > > �How must I declare those parameters? (ada functions doesn't allow out > parameters) If you are using GNAT, read the user's guide, section The GNAT Compilation Model | Mixed Language Programming | Calling Conventions. This says that GNAT Convention C follows the Ada 95 Reference manual, section B.3. That, in turn, says in paragraph 70: 70. An Ada parameter of an array type with component type T, of any mode, is passed as a t* argument to a C function, where t is the C type corresponding to the Ada type T. So just declare the corresponding Ada array, and it will be passed by reference. If you are not using GNAT, see if your compiler also follows B.3 (70). -- -- Stephe