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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ced04d0f82bf1abe X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Missing CR/LF in Gnat files? Reply-To: anon@anon.org (anon) References: <13eomjrhjs3al0a@corp.supernews.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: <6AiHi.102035$ax1.44338@bgtnsc05-news.ops.worldnet.att.net> Date: Sun, 16 Sep 2007 23:00:18 GMT NNTP-Posting-Host: 12.64.54.155 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1189983618 12.64.54.155 (Sun, 16 Sep 2007 23:00:18 GMT) NNTP-Posting-Date: Sun, 16 Sep 2007 23:00:18 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:1960 Date: 2007-09-16T23:00:18+00:00 List-Id: The other who suggest "unix2dos", well it does not fully handle Windows version of Latin-1, since DOS is no longer supported. An Ada program using "put_line" or "new_line" only inserts a "ASCII.LF" character and not the "LF/CR" pair of characters. Below is a program that correct this. But the best solution is to get a Unicode Editor! Instead of editing the files! -- -- -- Fix_Files output.txt -- -- with Ada.Text_IO ; use Ada.Text_IO ; procedure Fix_Files is char : Character ; begin -- Fix_Files while not End_of_File ( Standard_input ) loop -- -- Transfer line and stop of end_of_line. -- while not End_of_Line ( Standard_input ) loop get ( item => char ) ; put ( item => char ) ; end loop ; -- -- process end_of_line -- skip_line ; -- These two "put' statements insert the correct -- Control characters in the correct order. put ( item => ASCII.CR ) ; put ( item => ASCII.LF ) ; end loop ; -- -- Catch any file allocations or end_errors -- exception when End_Error => put ( item => ASCII.CR ) ; put ( item => ASCII.LF ) ; end Fix_Files ; Reasons: The Ada RM 2.2 (2) states "The text of a compilation is divided into lines. In general, the representation for an end of line is implementation defined. However, a sequence of one or more format_effectors other than character tabulation (HT) signifies at least one end of line." Which means that any Ada compiler or Ada IDE editor should be able to handle many different text forms of compilation units, but that does not mean that Microsoft OS can, especially the newly released Vista. Microsoft, uses many difference versions of Latin-1 and Ada uses ISO 10646 BMP [ RM 2.1 (4) ] for its character set. So you should not need to alter the Win32Ada files to compile. And if you want to use them to print out or as a reference from an editor it is better to download a editor for your OS that can handle ISO 10646 BMP aka a Unicode editor. Plus, this new editor should be able to handle in additional or updated Ada compilers or subsystems. A true Unicode or ISO 10464 editor can handle a character set up to 16 to 32 bits for multi-languages. And should be able to convert to many character sub-set such as Windows version of Latin-1. In <13eomjrhjs3al0a@corp.supernews.com>, "Phaedrus" writes: >Sorry to eat bandwidth with a silly question, but has anyone else had a >problem with the Gnat install where files in Gnat\bindings\Win32Ada are >missing carriage returns and/or linefeeds? Seems like I've run into this >problem before, but I can't seem to remember how to fix the files... It >sure is a pain to try to find anything in win32-winbase.ads when the file is >one looooooong line!!! > >Thanks in advance! >Brian > >