[PATCH 1/5] include: Add wmemchr to wchar.h

Alex Henrie alexhenrie24 at gmail.com
Sun May 27 22:05:52 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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h
index a6797246af..a51deb14f9 100644
--- a/include/msvcrt/wchar.h
+++ b/include/msvcrt/wchar.h
@@ -476,6 +476,14 @@ size_t  __cdecl wcrtomb(char*,wchar_t,mbstate_t*);
 size_t  __cdecl wcsrtombs(char*,const wchar_t**,size_t,mbstate_t*);
 int     __cdecl wctob(wint_t);
 
+static inline wchar_t* __cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n)
+{
+    const wchar_t *end;
+    for (end = s + n; s < end; s++)
+        if (*s == c) return (wchar_t*)s;
+    return NULL;
+}
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.17.0




More information about the wine-devel mailing list