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-Thread: 103376,8ecbc35ea893182f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Interfacing to C: big structures Date: Tue, 26 Feb 2008 09:05:48 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <62idb0F23ddfnU1@mid.individual.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1204034749 32736 192.74.137.71 (26 Feb 2008 14:05:49 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 26 Feb 2008 14:05:49 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:42KTvwRl4JbnVYdJKTH5TfhWol8= Xref: g2news1.google.com comp.lang.ada:20089 Date: 2008-02-26T09:05:48-05:00 List-Id: "Alex R. Mosteo" writes: > 2. Create an Ada type as > > type S is new Ada.Streams.Stream_Element_Array > (1 .. Stream_Offset (Size_Of_S)); > pragma Pack (S); -- Not sure if this is even needed. > > Note that this type gets its size at elaboration time, and thus this is > what fixes this type if the C corresponding struct changes. Nice trick. But I think you need to make sure the alignment is correct. - Bob