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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f2513845b4ef39f X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: More C Date: 2000/02/03 Message-ID: #1/1 X-Deja-AN: 581305291 Sender: kst@king.cts.com References: <3896134b@eeyore.callnetuk.com> X-Trace: thoth.cts.com 949621401 64282 198.68.168.21 (3 Feb 2000 23:43:21 GMT) Organization: CTS Network Services Newsgroups: comp.lang.ada X-Complaints-To: newsmaster@cts.com Date: 2000-02-03T00:00:00+00:00 List-Id: Jan Kroken 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 San Diego Supercomputer Center <*> Welcome to the last year of the 20th century.