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
|
||||
#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
|
||||
|
||||
Vendored
+2
@@ -209,12 +209,14 @@ struct Hash<unsigned char> : public phmap_unary_function<unsigned char, size_t>
|
||||
{ return static_cast<size_t>(val); }
|
||||
};
|
||||
|
||||
#ifdef PHMAP_HAS_NATIVE_WCHAR_T
|
||||
template <>
|
||||
struct Hash<wchar_t> : public phmap_unary_function<wchar_t, size_t>
|
||||
{
|
||||
inline size_t operator()(wchar_t val) const noexcept
|
||||
{ return static_cast<size_t>(val); }
|
||||
};
|
||||
#endif
|
||||
|
||||
template <>
|
||||
struct Hash<int16_t> : public phmap_unary_function<int16_t, size_t>
|
||||
|
||||
Reference in New Issue
Block a user