Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!voder!pyramid!ctnews!mitisft!dold From: dold@mitisft.Convergent.COM (Clarence Dold) Newsgroups: comp.lang.c Subject: Re: Portability vs. Endianness, an official answer(?) Message-ID: <1920@mitisft.Convergent.COM> Date: 14 Mar 91 16:25:13 GMT References: Organization: Convergent Technologies, San Jose, CA Lines: 20 in article , ersys!markt@nro.cs.athabascau.ca (Mark Tarrabain) says: > this is slightly machine dependant - it assumes that the size of a long Why not get really machine dependent? Let the vendor do it for you. If you have networking, you should have routines to put and fetch 'network byte order' values, BYTEORDER(3N). There are macros htonl, ntohl, etc, for converting to/from host style to network style. Snoop around for in.h. On our Motorola box, it is a noop. On the Intel box, it is some in-line assembly. (I don't really dispense official answers, but I thought it was a catchy change to the subject line...) -- --- Clarence A Dold - dold@tsmiti.Convergent.COM ...pyramid!ctnews!tsmiti!dold