diff --git a/src/cstring.h b/src/cstring.h index fcabb2e6..66d97f42 100644 --- a/src/cstring.h +++ b/src/cstring.h @@ -36,7 +36,7 @@ SOFTWARE. #include "hash.h" #if defined(ETL_COMPILER_MICROSOFT) - #undef min +#undef min #endif namespace etl @@ -185,19 +185,21 @@ namespace etl //************************************************************************* /// Hash function. //************************************************************************* +#if ETL_8BIT_SUPPORT template <> struct hash { size_t operator()(const etl::istring& text) const { - return etl::__private_hash__::generic_hash<>(reinterpret_cast(&text[0]), - reinterpret_cast(&text[text.size()])); + return etl::__private_hash__::generic_hash<>(reinterpret_cast(&text[0]), + reinterpret_cast(&text[text.size()])); } }; +#endif } #if defined(ETL_COMPILER_MICROSOFT) - #define min(a,b) (((a) < (b)) ? (a) : (b)) +#define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif diff --git a/src/u16string.h b/src/u16string.h index 95766d2b..55a39084 100644 --- a/src/u16string.h +++ b/src/u16string.h @@ -185,6 +185,7 @@ namespace etl //************************************************************************* /// Hash function. //************************************************************************* +#if ETL_8BIT_SUPPORT template <> struct hash { @@ -194,6 +195,7 @@ namespace etl reinterpret_cast(&text[text.size()])); } }; +#endif } #if defined(ETL_COMPILER_MICROSOFT) diff --git a/src/u32string.h b/src/u32string.h index 4493acad..6d16f36c 100644 --- a/src/u32string.h +++ b/src/u32string.h @@ -185,6 +185,7 @@ namespace etl //************************************************************************* /// Hash function. //************************************************************************* +#if ETL_8BIT_SUPPORT template <> struct hash { @@ -194,6 +195,7 @@ namespace etl reinterpret_cast(&text[text.size()])); } }; +#endif } #if defined(ETL_COMPILER_MICROSOFT) diff --git a/src/wstring.h b/src/wstring.h index 6633173c..0f015e00 100644 --- a/src/wstring.h +++ b/src/wstring.h @@ -186,6 +186,7 @@ namespace etl //************************************************************************* /// Hash function. //************************************************************************* +#if ETL_8BIT_SUPPORT template <> struct hash { @@ -195,6 +196,7 @@ namespace etl reinterpret_cast(&text[text.size()])); } }; +#endif } #if defined(ETL_COMPILER_MICROSOFT)