comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Interfaces.C and void *
Date: 1999/09/22
Date: 1999-09-22T00:00:00+00:00	[thread overview]
Message-ID: <37E90F43.C65F6703@averstar.com> (raw)
In-Reply-To: 87btavxw93.fsf@deneb.cygnus.argh.org

Florian Weimer wrote:
> 
> Recently, I wrote a binding for a C library which provides an abstract
> data type and completely hides the underlying representation of the type
> (i.e., all the public routines work on pointers to void).
> 
> Is there really no portable equivalent of a C void * in Interfaces.C?
> I used Interfaces.C.Strings.chars_ptr, which should be quite portable in
> practice, but AFAIK, ISO C doesn't require the representation of void *
> and char * to be identical.

Adding a void_ptr to Interfaces.C would seem like a reasonable addendum
to the standard.  In the interim, I would define a type in your own
code, such as:
    type Void_Ptr is private;
   ...
    type Void_Ptr is new System.Address;

This way, you will only need to change the definition in one place
if that becomes necessary (which I doubt, in practice).

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  reply	other threads:[~1999-09-22  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-22  0:00 Interfaces.C and void * Florian Weimer
1999-09-22  0:00 ` Tucker Taft [this message]
1999-09-22  0:00 ` Keith Thompson
1999-09-22  0:00 ` Ted Dennison
replies disabled

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