[PATCH] boost::serialization::version workaround

Vladislav Zavjalov slazav на altlinux.org
Пт Мар 12 00:44:21 UTC 2010


---
 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<class Archive>
         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<class Archive>
         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<class Archive>
-        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


--5mCyUwZo2JvN/JJP--


Подробная информация о списке рассылки Devel