From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: Why does DJGPP's getw not read Borlands getw? Date: Thu, 01 Jan 1998 15:23:33 +0100 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 35 Message-ID: <34ABA6E5.77ACCFDB@LSTM.Ruhr-UNI-Bochum.De> References: <34A96539 DOT 424E AT ns DOT sympatico DOT ca> <34AA761F DOT 1C2E AT cs DOT com> NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk John M. Aldrich wrote: [...] > Binary files are notoriously nonportable between compilers, not only > because of type sizes. Especially when reading or writing structs, > different compilers will use different packing/alignment schemes for > struct members. Even worse, different machine architectures (and > sometimes different operating systems on a given machine) use different > byte ordering systems for integers. And don't even think about trying > to read or write floating point numbers! Still, it sometimes works. I do happily share binary grid and result files between my PC and AIX RISC stations. Some care has to be taken about the endianess, but as both compilers have the same ideas about the size of variables, and by lucky chance the representation of floats is the same (IEEE), this works fine (In fact, it's the same compiler, gcc). I haven't tried structs, though. With the HP in the CC this fails. But admittedly, you will have to know what you are doing. Some conditional defines and typedefs for INT8, INT16, INT32 and alikes may save your day. -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************