A solution to this problem is to pick a canonical format for messages and data files that is the same no matter what the CPU. The Taligent Application Environment package for reading and writing objects (TStream) already does this. TStream also has static member functions you can call to convert to and from this canonical format without using a stream.
Just because you have a canonical format doesn't mean you must pay a big overhead every time you access your data. One alternative is to perform the translation to or from the canonical format at a predetermined time. For example, TrueType outline fonts have a certain canonical format that depends heavily on the 680x0 architecture. However, you could convert them to a convenient local format when they are installed or when they are used, rather than accessing them directly in their canonical format.
Some data types aren't portable:
int
, long
double
, and any pointer or pointer to member.
size_t
and ptrdiff_t
, have definitions that vary between CPUs.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Generated with WebMaker