Alex Henrie : include: Add wmemchr to wchar.h.

Alexandre Julliard julliard at winehq.org
Thu Sep 13 03:49:14 CDT 2018


Module: wine
Branch: stable
Commit: d04baa1655de9940df8f06f45f8467cddb825c05
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d04baa1655de9940df8f06f45f8467cddb825c05

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Sun May 27 21:05:52 2018 -0600

include: Add wmemchr to wchar.h.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit e1bfd4b4cb9c05039e29ae769d1582b63ed6fe46)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

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

diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h
index 7f5428f..8f184e7 100644
--- a/include/msvcrt/wchar.h
+++ b/include/msvcrt/wchar.h
@@ -475,6 +475,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 *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




More information about the wine-cvs mailing list