[PATCH 2/5] include: Add wmemcmp to wchar.h

Alex Henrie alexhenrie24 at gmail.com
Sun May 27 22:05:53 CDT 2018


Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
For https://bugs.winehq.org/show_bug.cgi?id=43300

 include/msvcrt/wchar.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h
index a51deb14f9..6fe6f11828 100644
--- a/include/msvcrt/wchar.h
+++ b/include/msvcrt/wchar.h
@@ -484,6 +484,17 @@ static inline wchar_t* __cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n)
     return NULL;
 }
 
+static inline int __cdecl wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+    size_t i;
+    for (i = 0; i < n; i++)
+    {
+        if (s1[i] > s2[i]) return 1;
+        if (s1[i] < s2[i]) return -1;
+    }
+    return 0;
+}
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.17.0




More information about the wine-devel mailing list