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,32e730fd939a8067 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Fri, 14 Oct 2005 17:54:20 -0500 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: changing alignment of built-in boolean References: <1129320236.007525.185300@g44g2000cwa.googlegroups.com> Date: Sat, 15 Oct 2005 00:55:43 +0200 Message-ID: <8764rzhfo0.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:mOc9oVAV2TNR7aOUTQkWyS4d4ps= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 83.134.238.198 X-Trace: sv3-eQPc0sra8cEuAxIZxQ4ewYKDXQykZLBG8SpIaknwP8ZsTwW4y06Ufxbfivv0SMcaIoffLnDsNLYX4hI!iDFLwSKQpFufrLY4MfOuKtf+A826hNire7jMAV4gbwe7dhUNv9Iqz6xbsdUccw/2Cy87QtKBl8c= X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:5666 Date: 2005-10-15T00:55:43+02:00 List-Id: invalidemail@aerojockey.com writes: > Is it possible, in GNAT, to force the built-in Boolean type to use > 4-byte (32-bit) alignment? Reason: I have to interface some Ada code > to a package that insists on 32-bit variables on 4-byte-aligned > addresses. > > Feel free to suggest some other strategy for accomplishing this, though > I'd prefer not to make extensive changes to the Ada code (such as > changing it to use a subtype of Boolean). > > I'm using GNAT 3.15p on HPUX. > > Thanks. type T is record B : Boolean; ... end record; for T use record B at 0 range 0 .. 31; ... end record; package P is subtype External_Boolean is Boolean; for External_Boolean'Size use 32; for External_Boolean'Alignment use 32; procedure External (B : in External_Boolean); pragma Import (C, External, "some_function"); end P; -- Ludovic Brenta.