comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst@cts.com>
Subject: Re: More C
Date: 2000/02/03
Date: 2000-02-03T00:00:00+00:00	[thread overview]
Message-ID: <yec1z6t26p2.fsf@king.cts.com> (raw)
In-Reply-To: vhioga1r2j8.fsf@grotte.ifi.uio.no

Jan Kroken <jankr@nntp.ifi.uio.no> writes:
[...]
> What if the compiler decides to optimize access to the record,
> so the real memory structure becomes as follows?
> 
> for SDL_Color use
>    record
>      Red   at 0  range 0..7;
>      Green at 32 range 32..39;
>      Blue  at 64 range 64..71;
>    end record;
> for SDL_Color'Size use 128;

You should be able to use pragma Convention(C, SDL_Color); it's then
up to the Ada compiler to lay out the record the same way the C
compiler does.

If it doesn't do this properly, you may have to resort to record
representation clauses, or perhaps to an implementation-defined
pragma.

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Welcome to the last year of the 20th century.




      parent reply	other threads:[~2000-02-03  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <vhizotrc4x7.fsf@grotte.ifi.uio.no>
2000-01-28  0:00 ` More C Gautier
2000-01-28  0:00 ` Jeff Carter
2000-01-28  0:00 ` tmoran
2000-01-28  0:00   ` David Starner
2000-01-28  0:00     ` Pascal Obry
2000-01-28  0:00       ` David Starner
2000-01-28  0:00         ` tmoran
2000-01-30  0:00 ` Nick Roberts
     [not found]   ` <vhioga1r2j8.fsf@grotte.ifi.uio.no>
2000-02-01  0:00     ` tmoran
2000-02-02  0:00     ` Nick Roberts
2000-02-03  0:00     ` Keith Thompson [this message]
replies disabled

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