comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Interfacing to C without dynamic memory
Date: Fri, 14 Nov 2008 18:13:59 -0500
Date: 2008-11-14T18:13:59-05:00	[thread overview]
Message-ID: <wcczlk1vr2g.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 8a0e9a41-6670-486b-bbb7-7ef706643930@a17g2000prm.googlegroups.com

Maciej Sobczak <see.my.homepage@gmail.com> writes:

> My first ideas are:
> 1. Extract sizeof(T) at C level.
> 2. In Ada, create appropriately aligned:
>
> type T is System.Storage_Array (1 .. Size_Of_T);
> for T'Alignment use Appropriate_Alignment_Value;

Makes sense.  You could write a C program that #include's
the relevant .h file, and prints out an Ada package
spec containing the above Ada code.  You could run
this as part of your build scripts.

- Bob



  parent reply	other threads:[~2008-11-14 23:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 13:58 Interfacing to C without dynamic memory Maciej Sobczak
2008-11-14 20:35 ` Damien Carbonne
2008-11-15  1:12   ` Randy Brukardt
2008-11-14 23:13 ` Robert A Duff [this message]
2008-11-15 11:52   ` Samuel Tardieu
2008-11-16 21:31     ` Maciej Sobczak
replies disabled

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