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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,191ad4ca9c7033e2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.germany.com!newsfeed.stueberl.de!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT.Sockets Date: Wed, 10 Oct 2007 05:52:41 +0100 Organization: Pushface Message-ID: References: <1191962179.754006.134610@k79g2000hse.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1191991965 1573 62.49.19.209 (10 Oct 2007 04:52:45 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 10 Oct 2007 04:52:45 +0000 (UTC) Cancel-Lock: sha1:k+iN9mm6UtXsJNGSghPw6SeY3to= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news2.google.com comp.lang.ada:2397 Date: 2007-10-10T05:52:41+01:00 List-Id: Maciej Sobczak writes: > On 9 Pa , 17:10, a...@anon.org (anon) wrote: > >> -- Get message length >> >> Integer'Read ( Channel, Length_Message ) ; > > How does it deal with endianness issues? > Or in general with different representation on two communicating > platforms? AdaCore supply an alternate body for System.Stream_Attributes (s-stratt.adb) in s-strxdr.adb. This converts to/from XDR representation on the fly. One way to deal with this is to copy s-strxdr.adb to s-stratt.adb in your source path and use gnatmake -a. Another is to rebuild the RTS (there's a makefile in adalib or adainclude, forget which) and use the --RTS= switch (I think in GPR package Builder). As a matter of interest, we found that the PowerPC (G4)'s native representation is the same as XDR except for Wide_Character, which is 2 bytes natively and 4 via s-strxdr.adb. That's 3.16a1, not sure about the latest releases. We don't use Wide_Character, so we can use the native RTS on VxWorks/PPC and XDR on the host (intel) side; the XDR conversions for floats look complex & possibly loady, not measured, but more important is reducing the need to modify third-party tools and code.