diff options
Diffstat (limited to 'include/typeinfo')
-rw-r--r-- | include/typeinfo | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/include/typeinfo b/include/typeinfo index 8624b349764a..7e8d3990ed98 100644 --- a/include/typeinfo +++ b/include/typeinfo @@ -69,18 +69,17 @@ public: #pragma GCC system_header #endif -#if defined(_LIBCPP_ABI_MICROSOFT) -#include <vcruntime_typeinfo.h> -#elif defined(_LIBCPP_NONUNIQUE_RTTI_BIT) +#if !defined(_LIBCPP_ABI_MICROSOFT) +#if defined(_LIBCPP_NONUNIQUE_RTTI_BIT) #define _LIBCPP_HAS_NONUNIQUE_TYPEINFO #else #define _LIBCPP_HAS_UNIQUE_TYPEINFO #endif +#endif namespace std // purposefully not using versioning namespace { -#if !defined(_LIBCPP_ABI_MICROSOFT) class _LIBCPP_EXCEPTION_ABI type_info { type_info& operator=(const type_info&); @@ -92,7 +91,17 @@ class _LIBCPP_EXCEPTION_ABI type_info { return __builtin_strcmp(name(), __arg.name()); } #endif +#if defined(_LIBCPP_ABI_MICROSOFT) + mutable struct { + const char *__undecorated_name; + const char __decorated_name[1]; + } __data; + + int __compare(const type_info &__rhs) const _NOEXCEPT; +#endif // _LIBCPP_ABI_MICROSOFT + protected: +#if !defined(_LIBCPP_ABI_MICROSOFT) #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO) // A const char* with the non-unique RTTI bit possibly set. uintptr_t __type_name; @@ -106,11 +115,27 @@ protected: _LIBCPP_INLINE_VISIBILITY explicit type_info(const char* __n) : __type_name(__n) {} #endif +#endif // ! _LIBCPP_ABI_MICROSOFT public: _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE virtual ~type_info(); +#if defined(_LIBCPP_ABI_MICROSOFT) + const char *name() const _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + bool before(const type_info& __arg) const _NOEXCEPT { + return __compare(__arg) < 0; + } + + size_t hash_code() const _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + bool operator==(const type_info& __arg) const _NOEXCEPT { + return __compare(__arg) == 0; + } +#else #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO) _LIBCPP_INLINE_VISIBILITY const char* name() const _NOEXCEPT @@ -167,6 +192,7 @@ public: bool operator==(const type_info& __arg) const _NOEXCEPT { return __type_name == __arg.__type_name; } #endif +#endif // _LIBCPP_ABI_MICROSOFT _LIBCPP_INLINE_VISIBILITY bool operator!=(const type_info& __arg) const _NOEXCEPT @@ -191,8 +217,6 @@ public: virtual const char* what() const _NOEXCEPT; }; -#endif // !_LIBCPP_ABI_MICROSOFT - } // std _LIBCPP_BEGIN_NAMESPACE_STD |