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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d3b2e17058959a22 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-25 16:47:25 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!news.sprintlink.net!crash!telesoft!kst From: kst@thomsoft.com (Keith Thompson) Subject: Re: C++ to Ada95, help please X-Nntp-Posting-Host: pulsar Message-ID: Originator: kst@pulsar Sender: news@thomsoft.com (USENET News Admin @flash) Organization: Thomson Software Products, San Diego, CA, USA References: <3kjd2m$d3t@jerry.rb.icl.co.uk> Date: Sat, 25 Mar 1995 10:02:01 GMT Date: 1995-03-25T10:02:01+00:00 List-Id: In vladimir@speedy.intrepid.com (Vladimir Vukicevic) writes: > Of course, a representation clause for the record is needed above, as > there are no guarantees that the Ada compiler will arrange this record > in memory to correspond to the C struct/union. Something like the following > is needed: > > for struct_STRUCT_NAME use > record > item1 at 0 range 0 .. 7; > u_item1 at 1 range 0 .. 7; > u_item2 at 1 range 0 .. 7; > item2 at 2 range 0 ..7; > end record; In Ada 95, you can just use pragma Convention(C, struct_STRUCT_NAME); -- Keith Thompson (The_Other_Keith) kst@thomsoft.com (kst@alsys.com still works) TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718 That's Keith Thompson *with* a 'p', Thomson Software Products *without* a 'p'.