From 0327cc0b3cc2a5fb1ffc069fc845662b932eef40 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 18 Mar 2020 11:57:28 +0700 Subject: [PATCH] Remove MSVC's wmemchr declaration --- src/windows/gnu/mod.rs | 8 ++++++++ src/windows/mod.rs | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/windows/gnu/mod.rs b/src/windows/gnu/mod.rs index e74628b9..3e906967 100644 --- a/src/windows/gnu/mod.rs +++ b/src/windows/gnu/mod.rs @@ -13,6 +13,14 @@ extern "C" { s2: *const ::c_char, n: ::size_t, ) -> ::c_int; + + // NOTE: For MSVC target, `wmemchr` is only a inline function in `` + // header file. We cannot find a way to link to that symbol from Rust. + pub fn wmemchr( + cx: *const ::wchar_t, + c: ::wchar_t, + n: ::size_t, + ) -> *mut ::wchar_t; } cfg_if! { diff --git a/src/windows/mod.rs b/src/windows/mod.rs index fcbe0bf7..54421dd4 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -378,7 +378,6 @@ 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,