Commit 746deb0c authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

let the key type in StaticSingletonManager be exported

Summary: When using multiple libraries in multiple `.so`s, it is sometimes expected that a type be marked `FOLLY_EXPORT` for them to be understood as the same type in RTTI contexts. This turns out to be the case with exceptions. And `StaticSingletonManager` is an RTTI context as well.

Reviewed By: simpkins

Differential Revision: D32979714

fbshipit-source-id: 92b0032428d7a1a184ef886b67034216ee245e64
parent c623b45b
......@@ -107,6 +107,8 @@ class StaticSingletonManagerWithRtti {
using Key = std::type_info;
using Make = void*();
using Cache = std::atomic<void*>;
template <typename T, typename Tag>
struct FOLLY_EXPORT Src {};
struct Arg {
Cache cache{}; // should be first field
Key const* key;
......@@ -116,7 +118,7 @@ class StaticSingletonManagerWithRtti {
// function, but typeid is not constexpr under msvc
template <typename T, typename Tag>
/* implicit */ constexpr Arg(tag_t<T, Tag>) noexcept
: key{FOLLY_TYPE_INFO_OF(tag_t<T, Tag>)}, make{thunk::make<T>} {}
: key{FOLLY_TYPE_INFO_OF(Src<T, Tag>)}, make{thunk::make<T>} {}
};
template <bool Noexcept>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment