Skip to content

Commit

Permalink
fix CEREAL_*_DYNAMIC_INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
WSoptics committed Sep 1, 2017
1 parent 51cbda5 commit baeb6d8
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions include/cereal/types/polymorphic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,19 @@
See CEREAL_REGISTER_DYNAMIC_INIT for detailed explanation
of how this macro should be used. The name used should
match that for CEREAL_REGISTER_DYNAMIC_INIT. */
#define CEREAL_FORCE_DYNAMIC_INIT(LibName) \
namespace cereal { \
namespace detail { \
void dynamic_init_dummy_##LibName(); \
} /* end detail */ \
namespace { \
void dynamic_init_##LibName() \
{ \
::cereal::detail::dynamic_init_dummy_##LibName(); \
} \
} } /* end namespaces */
#define CEREAL_FORCE_DYNAMIC_INIT(LibName) \
namespace cereal { \
namespace detail { \
void dynamic_init_dummy_##LibName(); \
} /* end detail */ \
} /* end cereal */ \
namespace { \
struct dynamic_init_##LibName { \
dynamic_init_##LibName() { \
::cereal::detail::dynamic_init_dummy_##LibName(); \
} \
} dynamic_init_instance_##LibName; \
} /* end anonymous namespace */

namespace cereal
{
Expand Down

0 comments on commit baeb6d8

Please sign in to comment.