diff --git a/include/cereal/types/polymorphic.hpp b/include/cereal/types/polymorphic.hpp index 5c33d8e8d..f3db78f6c 100644 --- a/include/cereal/types/polymorphic.hpp +++ b/include/cereal/types/polymorphic.hpp @@ -165,18 +165,18 @@ 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 */ \ - } /* end cereal */ \ - namespace { \ - struct dynamic_init_##LibName { \ - dynamic_init_##LibName() { \ - ::cereal::detail::dynamic_init_dummy_##LibName(); \ - } \ - } dynamic_init_instance_##LibName; \ +#define CEREAL_FORCE_DYNAMIC_INIT(LibName) \ + namespace cereal { \ + namespace detail { \ + void CEREAL_DLL_EXPORT 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