Skip to content

Commit

Permalink
Merge pull request #430 from WSoptics/dynamic_init
Browse files Browse the repository at this point in the history
fix CEREAL_*_DYNAMIC_INIT
  • Loading branch information
AzothAmmo authored Sep 6, 2017
2 parents 0adf9e6 + baeb6d8 commit 7292a60
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 7292a60

Please sign in to comment.