From: Simon Wright <simon@pushface.org>
Subject: Re: Interfacing between Ada and C: records and structs
Date: Tue, 31 Jul 2012 20:23:45 +0100
Date: 2012-07-31T20:23:45+01:00 [thread overview]
Message-ID: <m2zk6floou.fsf@nidhoggr.home> (raw)
In-Reply-To: 5813d3d2-8a9f-4a08-bf09-db3c62847593@googlegroups.com
awdorrin <awdorrin@gmail.com> writes:
> private
> type Dummy is tagged null record;
> type Mutex is record
> Mutex : aliased POSIX.C.pthread_mutex_t;
> D : Dummy;
> end record
What's D : Dummy doing here? There's no equivalent in the C.
Here, on an x86_64 compiler,
package Mutex is
type pthread_mutex_t is new Boolean with
Alignment => 8,
Size => 192;
type Dummy is tagged null record;
type Mutex is record
Mutex : aliased pthread_mutex_t;
D : Dummy;
end record;
end Mutex;
compiled with -gnat12 -gnatR3 gives
for Pthread_Mutex_T'Size use 192;
for Pthread_Mutex_T'Alignment use 8;
for Dummy'Size use 64;
for Dummy'Alignment use 8;
for Dummy use record
_Tag at 0 range 0 .. 63;
end record;
for Mutex'Size use 256;
for Mutex'Alignment use 8;
for Mutex use record
Mutex at 0 range 0 .. 191;
D at 24 range 0 .. 63;
end record;
next prev parent reply other threads:[~2012-08-06 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-31 16:38 Interfacing between Ada and C: records and structs awdorrin
2012-07-31 17:16 ` Niklas Holsti
2012-07-31 18:44 ` awdorrin
2012-07-31 19:08 ` awdorrin
2012-07-31 19:27 ` Simon Wright
2012-07-31 19:44 ` awdorrin
2012-07-31 20:46 ` Niklas Holsti
2012-08-01 12:16 ` awdorrin
2012-07-31 19:23 ` Simon Wright [this message]
2012-08-02 4:39 ` Shark8
2012-08-02 12:32 ` awdorrin
[not found] <7beb59ba-ca6f-476e-8b39-604196b0b79f@googlegroups.com>
2012-08-01 2:51 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox