mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 16:40:39 +08:00
Add support for msvc:/Zc:wchar_t-
This commit is contained in:
Vendored
+7
@@ -338,6 +338,13 @@
|
|||||||
#define PHMAP_INTERNAL_MSVC_2017_DBG_MODE
|
#define PHMAP_INTERNAL_MSVC_2017_DBG_MODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Checks whether wchar_t is treated as a native type
|
||||||
|
// (MSVC: /Zc:wchar_t- treats wchar_t as unsigned short)
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
|
||||||
|
#define PHMAP_HAS_NATIVE_WCHAR_T
|
||||||
|
#endif
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Sanitizer Attributes
|
// Sanitizer Attributes
|
||||||
|
|||||||
Vendored
+2
@@ -209,12 +209,14 @@ struct Hash<unsigned char> : public phmap_unary_function<unsigned char, size_t>
|
|||||||
{ return static_cast<size_t>(val); }
|
{ return static_cast<size_t>(val); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef PHMAP_HAS_NATIVE_WCHAR_T
|
||||||
template <>
|
template <>
|
||||||
struct Hash<wchar_t> : public phmap_unary_function<wchar_t, size_t>
|
struct Hash<wchar_t> : public phmap_unary_function<wchar_t, size_t>
|
||||||
{
|
{
|
||||||
inline size_t operator()(wchar_t val) const noexcept
|
inline size_t operator()(wchar_t val) const noexcept
|
||||||
{ return static_cast<size_t>(val); }
|
{ return static_cast<size_t>(val); }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct Hash<int16_t> : public phmap_unary_function<int16_t, size_t>
|
struct Hash<int16_t> : public phmap_unary_function<int16_t, size_t>
|
||||||
|
|||||||
Reference in New Issue
Block a user