comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Binding to functions having reference parameter
Date: 08 May 2002 11:19:10 -0400
Date: 2002-05-08T15:25:44+00:00	[thread overview]
Message-ID: <u8z6u651t.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: abbddn$m00$1@nsnmrro2-gest.nuria.telefonica-data.net

"Antonio L�pez" <alm@gtd.es.REMOVE> 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



  reply	other threads:[~2002-05-08 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-08 14:40 Binding to functions having reference parameter Antonio L�pez
2002-05-08 15:19 ` Stephen Leake [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-05-08 18:39 Beard, Frank [Contractor]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox