From c513a4b61fcb4f57c975cd383ae7f5f8c903e9f1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 15 Aug 2019 01:11:39 -0400 Subject: [PATCH] hecl/hecl: Make use of std::char_traits with StrNCmp Same behavior, but allows removing the use of ifdefs, unifying the code paths. --- hecl/include/hecl/hecl.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hecl/include/hecl/hecl.hpp b/hecl/include/hecl/hecl.hpp index 6797252cd..97a8b2b73 100644 --- a/hecl/include/hecl/hecl.hpp +++ b/hecl/include/hecl/hecl.hpp @@ -311,11 +311,8 @@ inline int StrCmp(const SystemChar* str1, const SystemChar* str2) { inline int StrNCmp(const SystemChar* str1, const SystemChar* str2, size_t count) { if (!str1 || !str2) return str1 != str2; -#if HECL_UCS2 - return wcsncmp(str1, str2, count); -#else - return strncmp(str1, str2, count); -#endif + + return std::char_traits::compare(str1, str2, count); } inline int StrCaseCmp(const SystemChar* str1, const SystemChar* str2) {