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!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: changing alignment of built-in boolean References: <1129320236.007525.185300@g44g2000cwa.googlegroups.com> In-Reply-To: <1129320236.007525.185300@g44g2000cwa.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 15 Oct 2005 06:40:45 GMT NNTP-Posting-Host: 67.3.180.32 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1129358445 67.3.180.32 (Fri, 14 Oct 2005 23:40:45 PDT) NNTP-Posting-Date: Fri, 14 Oct 2005 23:40:45 PDT Xref: g2news1.google.com comp.lang.ada:5677 Date: 2005-10-15T06:40:45+00:00 List-Id: invalidemail@aerojockey.com wrote: > 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. You could always modify the compiler :) You might want to look at user-defined boolean types here (it's sometimes a little confusing in Ada to distinguish between integer types and type Integer, character types and type Character, string types and type String, boolean types and type Boolean): type Big_Boolean is new Boolean; for Big_Boolean'Size use 32; for Big_Boolean'Alignment use 4; Conditions can be of any boolean type, so you can use this just like type Boolean: B : Big_Boolean; if B then ... while B loop ... exit Some_Loop when B; -- Jeff Carter "If a sperm is wasted, God gets quite irate." Monty Python's the Meaning of Life 56