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,c11f3836a5a201d3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-11 13:21:36 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!colt.net!dispose.news.demon.net!demon!nntp.news.xara.net!xara.net!gxn.net!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada References: <1s7V6.4021$Il5.510814@newsread1.prod.itd.earthlink.net> Subject: Re: Circular type definition problem X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Mon, 11 Jun 2001 21:16:27 +0100 NNTP-Posting-Host: 62.252.137.3 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 992290590 62.252.137.3 (Mon, 11 Jun 2001 21:16:30 BST) NNTP-Posting-Date: Mon, 11 Jun 2001 21:16:30 BST Organization: ntlworld News Service Xref: archiver1.google.com comp.lang.ada:8572 Date: 2001-06-11T21:16:27+01:00 List-Id: you could split out the implementation specifics into a seperate package e.g. with System.Direct_IO; package Project_Specifics is -- Specific to GNAT -- Direct_IO_Count_Last : constant := System.Direct_IO.Count'Last; end Project_Specifics; with Ada.Direct_Io; with Project_Specifics; package Temp is type Byte is mod 256; type Block; type Blockdata is array (0 .. 511) of Byte; type Node_Count is range 0 .. Project_Specifics.Direct_IO_Count_Last; type Block is record Next_Node : Node_Count; Data : Blockdata; end record; -- Block pragma Pack(Blockdata); pragma Pack(Block); package Node_Io is new Ada.Direct_Io(Block); use Node_Io; end Temp; "Charles Hixson" wrote in message news:1s7V6.4021$Il5.510814@newsread1.prod.itd.earthlink.net... > This is what I'm trying to do: > type Block; > package Node_IO is new Ada.Direct_IO(Block); > use Node_IO; > type BlockData is array (0..511) of Byte; > type Block is record > next_node : Node_IO.Count; > data : BlockData; > end record; -- Block > pragma pack(BlockData); > pragma pack(Block); > > Not too much to my surprise, it didn't work. Node_IO needs to be > defined with a real type. OTOH, the type Node_IO.Count is > defined within Node_IO, so I can't put it after the declaration > of Block. > > I suppose that I could just give up, and declare next_node to be > Long_Integer, but that seems so inelegant. Node_IO.Count is, > essentially, an Access variable (it says where in the file to > find the next Block). But I'm not really sure how to approach > this. Any suggestions?