Skip to content

Commit

Permalink
Merge pull request #1698 from lzutao/non-msvc-wmemchr
Browse files Browse the repository at this point in the history
Remove MSVC's wmemchr declaration
  • Loading branch information
JohnTitor authored Mar 18, 2020
2 parents 39f43b5 + 0327cc0 commit 276eaa2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/windows/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<wchar.h>`
// 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! {
Expand Down
1 change: 0 additions & 1 deletion src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 276eaa2

Please sign in to comment.