diff --git a/parallel_hashmap/phmap_config.h b/parallel_hashmap/phmap_config.h index 42b0664..fa51502 100644 --- a/parallel_hashmap/phmap_config.h +++ b/parallel_hashmap/phmap_config.h @@ -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 diff --git a/parallel_hashmap/phmap_utils.h b/parallel_hashmap/phmap_utils.h index 72d4e71..1d0c472 100644 --- a/parallel_hashmap/phmap_utils.h +++ b/parallel_hashmap/phmap_utils.h @@ -209,12 +209,14 @@ struct Hash : public phmap_unary_function { return static_cast(val); } }; +#ifdef PHMAP_HAS_NATIVE_WCHAR_T template <> struct Hash : public phmap_unary_function { inline size_t operator()(wchar_t val) const noexcept { return static_cast(val); } }; +#endif template <> struct Hash : public phmap_unary_function