From 723a2c7d87ee64e3775e068b92074cffb9b70fbd Mon Sep 17 00:00:00 2001
From: Lzu Tao <taolzu@gmail.com>
Date: Sun, 29 Dec 2019 18:07:18 +0700
Subject: [PATCH] add wmemchr to all platforms support memchr

---
 src/cloudabi/mod.rs | 1 +
 src/fuchsia/mod.rs  | 1 +
 src/unix/mod.rs     | 1 +
 src/vxworks/mod.rs  | 1 +
 src/windows/mod.rs  | 1 +
 5 files changed, 5 insertions(+)

diff --git a/src/cloudabi/mod.rs b/src/cloudabi/mod.rs
index b3065d72..71f6ff45 100644
--- a/src/cloudabi/mod.rs
+++ b/src/cloudabi/mod.rs
@@ -259,6 +259,7 @@ extern "C" {
     ) -> ::size_t;
 
     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
     pub fn memcpy(
         dest: *mut c_void,
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index f5e89573..c4467a8e 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -3401,6 +3401,7 @@ extern "C" {
     ) -> ::size_t;
 
     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
     pub fn memcpy(
         dest: *mut c_void,
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index ad0217f2..e1e9e499 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -546,6 +546,7 @@ extern "C" {
     ) -> ::size_t;
 
     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
     pub fn memcpy(
         dest: *mut c_void,
diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs
index 2df5f0d3..0b90f66b 100755
--- a/src/vxworks/mod.rs
+++ b/src/vxworks/mod.rs
@@ -1173,6 +1173,7 @@ extern "C" {
     ) -> ::size_t;
 
     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
     pub fn memcpy(
         dest: *mut c_void,
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index f440489a..2fe1d01d 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -378,6 +378,7 @@ extern "C" {
     ) -> ::size_t;
 
     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+    pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
     pub fn memcpy(
         dest: *mut c_void,
-- 
GitLab