Commit 2ca4c388 authored by Dmytro Stechenko's avatar Dmytro Stechenko Committed by Facebook GitHub Bot

fix duplicated symbols for dynamic::TypeInfo members

Summary:
while compiling on windows see duplicated symbols:
```
lld-link: error: duplicate symbol:
public: static char const *const folly::dynamic::TypeInfo<
class std::basic_string<char, struct std::char_traits<char>,
class std::allocator<char>>>::name
in buck-out\dev\gen\crypto\cat\cpp\tests\crypto_auth_token_util_test#compile-CryptoAuthTokenUtilTest.cpp.obj1f5bc0bc,windows-x86_64\out.obj
and in libdynamic.lib(out.obj)
```

Reviewed By: yfeldblum

Differential Revision: D20426321

fbshipit-source-id: 4e0346c624ad12561adb14f3a2e5f6e15bbbba26
parent c761da7b
......@@ -1003,21 +1003,21 @@ inline dynamic::dynamic(Array&& r) : type_(ARRAY) {
new (&u_.array) Array(std::move(r));
}
#define FOLLY_DYNAMIC_DEC_TYPEINFO(T, str, val) \
template <> \
struct dynamic::TypeInfo<T> { \
static constexpr const char* name = str; \
static constexpr dynamic::Type type = val; \
}; \
#define FOLLY_DYNAMIC_DEC_TYPEINFO(T, val) \
template <> \
struct dynamic::TypeInfo<T> { \
static const char* const name; \
static constexpr dynamic::Type type = val; \
}; \
//
FOLLY_DYNAMIC_DEC_TYPEINFO(std::nullptr_t, "null", dynamic::NULLT)
FOLLY_DYNAMIC_DEC_TYPEINFO(bool, "boolean", dynamic::BOOL)
FOLLY_DYNAMIC_DEC_TYPEINFO(std::string, "string", dynamic::STRING)
FOLLY_DYNAMIC_DEC_TYPEINFO(dynamic::Array, "array", dynamic::ARRAY)
FOLLY_DYNAMIC_DEC_TYPEINFO(double, "double", dynamic::DOUBLE)
FOLLY_DYNAMIC_DEC_TYPEINFO(int64_t, "int64", dynamic::INT64)
FOLLY_DYNAMIC_DEC_TYPEINFO(dynamic::ObjectImpl, "object", dynamic::OBJECT)
FOLLY_DYNAMIC_DEC_TYPEINFO(std::nullptr_t, dynamic::NULLT)
FOLLY_DYNAMIC_DEC_TYPEINFO(bool, dynamic::BOOL)
FOLLY_DYNAMIC_DEC_TYPEINFO(std::string, dynamic::STRING)
FOLLY_DYNAMIC_DEC_TYPEINFO(dynamic::Array, dynamic::ARRAY)
FOLLY_DYNAMIC_DEC_TYPEINFO(double, dynamic::DOUBLE)
FOLLY_DYNAMIC_DEC_TYPEINFO(int64_t, dynamic::INT64)
FOLLY_DYNAMIC_DEC_TYPEINFO(dynamic::ObjectImpl, dynamic::OBJECT)
#undef FOLLY_DYNAMIC_DEC_TYPEINFO
......
......@@ -30,18 +30,17 @@ namespace folly {
//////////////////////////////////////////////////////////////////////
#define FOLLY_DYNAMIC_DEF_TYPEINFO(T) \
constexpr const char* dynamic::TypeInfo<T>::name; \
constexpr dynamic::Type dynamic::TypeInfo<T>::type; \
#define FOLLY_DYNAMIC_DEF_TYPEINFO(T, str) \
const char* const dynamic::TypeInfo<T>::name = str; \
//
FOLLY_DYNAMIC_DEF_TYPEINFO(std::nullptr_t)
FOLLY_DYNAMIC_DEF_TYPEINFO(bool)
FOLLY_DYNAMIC_DEF_TYPEINFO(std::string)
FOLLY_DYNAMIC_DEF_TYPEINFO(dynamic::Array)
FOLLY_DYNAMIC_DEF_TYPEINFO(double)
FOLLY_DYNAMIC_DEF_TYPEINFO(int64_t)
FOLLY_DYNAMIC_DEF_TYPEINFO(dynamic::ObjectImpl)
FOLLY_DYNAMIC_DEF_TYPEINFO(std::nullptr_t, "null")
FOLLY_DYNAMIC_DEF_TYPEINFO(bool, "boolean")
FOLLY_DYNAMIC_DEF_TYPEINFO(std::string, "string")
FOLLY_DYNAMIC_DEF_TYPEINFO(dynamic::Array, "array")
FOLLY_DYNAMIC_DEF_TYPEINFO(double, "double")
FOLLY_DYNAMIC_DEF_TYPEINFO(int64_t, "int64")
FOLLY_DYNAMIC_DEF_TYPEINFO(dynamic::ObjectImpl, "object")
#undef FOLLY_DYNAMIC_DEF_TYPEINFO
......
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