>From 37e22a7215e7cd68aa5ee49a996bbed302b7c25e Mon Sep 17 00:00:00 2001 From: Vladislav Zavjalov Date: Fri, 12 Mar 2010 03:44:21 +0300 Subject: [PATCH] boost::serialization::version workaround --- fuse-encfs/encfs/FileUtils.cpp | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/fuse-encfs/encfs/FileUtils.cpp b/fuse-encfs/encfs/FileUtils.cpp index 73a589f..9e69b57 100644 --- a/fuse-encfs/encfs/FileUtils.cpp +++ b/fuse-encfs/encfs/FileUtils.cpp @@ -131,6 +131,10 @@ namespace boost void save(Archive &ar, const EncFSConfig &cfg, unsigned int version) { + //workaround: some boost versions wraps version to 65536! + //works for years 2006..2012 + if (version < 65536) version+=65536*306; + (void)version; ar << make_nvp("creator", cfg.creator); ar << make_nvp("cipherAlg", cfg.cipherIface); @@ -161,6 +165,10 @@ namespace boost template void load(Archive &ar, EncFSConfig &cfg, unsigned int version) { + //workaround: some boost versions wraps version to 65536! + //works for years 2006..2012 + if (version < 65536) version+=65536*306; + cfg.subVersion = version; ar >> make_nvp("creator", cfg.creator); ar >> make_nvp("cipherAlg", cfg.cipherIface); @@ -207,12 +215,20 @@ namespace boost template void serialize(Archive &ar, EncFSConfig &cfg, unsigned int version) { + //workaround: some boost versions wraps version to 65536! + //works for years 2006..2012 + if (version < 65536) version+=65536*306; + split_free(ar, cfg, version); } template - void serialize(Archive &ar, Interface &i, const unsigned int version) + void serialize(Archive &ar, Interface &i, unsigned int version) { + //workaround: some boost versions wraps version to 65536! + //works for years 2006..2012 + if (version < 65536) version+=65536*306; + (void)version; ar & make_nvp("name", i.name()); ar & make_nvp("major", i.current()); -- 1.6.5.3