In a message dated 6/14/2007 1:40:34 AM Eastern Standard Time, florian@freepascal.org writes:
How does the pascal macro compiler solve it? It tries to solve it for bit/booleans arrays but not for subrange types which are much harder because of endian issues. Tries because it doesn't take care of things like debugging.
(Continuing previous answer) If the problem is that some Pascal compilers store large integers with the least-significant byte first, while others store the most-significant byte first, one solution would be to form the concatenation of bit fields into a string of integers, and let each compiler store them according to its own rules.
How complex the macros become depends on what is needed. Do the bit fields need to cross boundaries of integer fields? Are mixed-sized integers needed within each record? Are you carving up a large array into bit fields whose lengths will be determined at runtime?
If the problem is that one compiler stores array elements in order x[1], x[2], x[3], ... which another compiler stores them x[100], x[99], ... then you simply let the compiler use its own array indexing scheme.
Frank
************************************** See what's free at http://www.aol.com.