diff --git a/include/cereal/details/polymorphic_impl.hpp b/include/cereal/details/polymorphic_impl.hpp index 45ab099fa..699527212 100644 --- a/include/cereal/details/polymorphic_impl.hpp +++ b/include/cereal/details/polymorphic_impl.hpp @@ -58,18 +58,18 @@ have been registered with CEREAL_REGISTER_ARCHIVE. This must be called after all archives are registered (usually after the archives themselves have been included). */ -#define CEREAL_BIND_TO_ARCHIVES(T) \ - namespace cereal { \ - namespace detail { \ - template<> \ - struct init_binding { \ - static bind_to_archives const & b; \ - static void unused() { (void)b; } \ - }; \ - bind_to_archives const & init_binding::b = \ - ::cereal::detail::StaticObject< \ - bind_to_archives \ - >::getInstance().bind(); \ +#define CEREAL_BIND_TO_ARCHIVES(...) \ + namespace cereal { \ + namespace detail { \ + template<> \ + struct init_binding<__VA_ARGS__> { \ + static bind_to_archives<__VA_ARGS__> const & b; \ + static void unused() { (void)b; } \ + }; \ + bind_to_archives<__VA_ARGS__> const & init_binding<__VA_ARGS__>::b = \ + ::cereal::detail::StaticObject< \ + bind_to_archives<__VA_ARGS__> \ + >::getInstance().bind(); \ }} /* end namespaces */ namespace cereal diff --git a/include/cereal/types/polymorphic.hpp b/include/cereal/types/polymorphic.hpp index 27e63e7f8..cbe2c8849 100644 --- a/include/cereal/types/polymorphic.hpp +++ b/include/cereal/types/polymorphic.hpp @@ -79,16 +79,16 @@ Polymorphic support in cereal requires RTTI to be enabled */ -#define CEREAL_REGISTER_TYPE(T) \ - namespace cereal { \ - namespace detail { \ - template <> \ - struct binding_name \ - { \ - STATIC_CONSTEXPR char const * name() { return #T; } \ - }; \ - } } /* end namespaces */ \ - CEREAL_BIND_TO_ARCHIVES(T) +#define CEREAL_REGISTER_TYPE(...) \ + namespace cereal { \ + namespace detail { \ + template <> \ + struct binding_name<__VA_ARGS__> \ + { \ + STATIC_CONSTEXPR char const * name() { return #__VA_ARGS__; } \ + }; \ + } } /* end namespaces */ \ + CEREAL_BIND_TO_ARCHIVES(__VA_ARGS__) //! Registers a polymorphic type with cereal, giving it a //! user defined name