|
Boost : |
From: Zrubavel Zodikovich (g729_at_[hidden])
Date: 2006-09-11 06:20:49
Thanks, Robert, that worked. I'll summarize the case here in case anyone
encounters similar problem.
We needed to read binary archives created on a different platform.
Changing the code to use portable_binary_archive was not an option - the
data was already written to disk. The problem turned out to be in string
serialization code, which depended on the size of std::size_t type.
Therefore, replacing the std::size_t with unsigned int in these two
files allowed us to read the archive on 64 bit platform.
* boost\archive\impl\basic_binary_iprimitive.ipp
* boost\archive\impl\basic_binary_oprimitive.ipp
The sizes of different types on our platforms were as follows :
type vc8 vc8-x64
------ ------ -------
void* 4 8
size_t 4 8
int 4 4
Robert Ramey wrote:
> That's the obvious place.
>
> I don't think anything is dependent upon pointer size - as pointers
> themselves are not stored.
>
> I suspect the problem will be when using integers - I would expect the sizes
> of these to change when moving to 64 bit platforms. After all size_t is an
> integer. If it were me I would just forget it. The best would be to just
> convert the binary archives into portable binary archives or something else.
> That is, if you want portability - don't use binary archive which optimized
> for speed.
>
> Robert Ramey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk