Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50546 - branches/release/boost/serialization trunk/boost/serialization
From: ramey_at_[hidden]
Date: 2009-01-12 01:21:28


Author: ramey
Date: 2009-01-12 01:21:27 EST (Mon, 12 Jan 2009)
New Revision: 50546
URL: http://svn.boost.org/trac/boost/changeset/50546

Log:
unique naming for export instantiation
Text files modified:
   branches/release/boost/serialization/export.hpp | 35 ++++++++++++-----------------------
   1 files changed, 12 insertions(+), 23 deletions(-)

Modified: branches/release/boost/serialization/export.hpp
==============================================================================
--- branches/release/boost/serialization/export.hpp (original)
+++ branches/release/boost/serialization/export.hpp 2009-01-12 01:21:27 EST (Mon, 12 Jan 2009)
@@ -146,33 +146,22 @@
     }
 };
 
+template<typename T>
+class init_guid {
+ static ::boost::archive::detail::guid_initializer<T> const
+ & guid_initializer;
+};
+
 } // namespace detail
 } // namespace archive
 } // namespace boost
 
 #define BOOST_CLASS_EXPORT_GUID(T, K) \
-namespace \
-{ \
- ::boost::archive::detail::guid_initializer< T > const & \
- BOOST_PP_CAT(boost_serialization_guid_initializer_, __LINE__) \
- = ::boost::serialization::singleton< \
- ::boost::archive::detail::guid_initializer< T > \
- >::get_mutable_instance().export_guid(K); \
-}
-
-// the following is solely to support de-serialization of pointers serialized
-// under 1.32
-#define BOOST_CLASS_EXPORT_GUID_1(T, K) \
-namespace \
-{ \
     ::boost::archive::detail::guid_initializer< T > const & \
- BOOST_PP_CAT( \
- boost_serialization_guid_initializer_, \
- BOOST_PP_CAT(__LINE__,_1) \
- ) = ::boost::serialization::singleton< \
- ::boost::archive::detail::guid_initializer< T > \
- >::get_mutable_instance().export_guid(K); \
-}
+ ::boost::archive::detail::init_guid<T>::guid_initializer = \
+ ::boost::serialization::singleton< \
+ ::boost::archive::detail::guid_initializer< T > \
+ >::get_mutable_instance().export_guid(K); \
 
 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
 
@@ -184,9 +173,9 @@
 # define BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(Base,Derived) \
 namespace \
 { \
- int BOOST_PP_CAT(boost_serialization_mwerks_init_, __LINE__) = \
+ static int BOOST_PP_CAT(boost_serialization_mwerks_init_, __LINE__) = \
       (::boost::archive::detail::instantiate_ptr_serialization((Derived*)0,0), 3); \
- int BOOST_PP_CAT(boost_serialization_mwerks_init2_, __LINE__) = ( \
+ static int BOOST_PP_CAT(boost_serialization_mwerks_init2_, __LINE__) = ( \
       ::boost::serialization::void_cast_register((Derived*)0,(Base*)0) \
     , 3); \
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk