Skip to content

Commit 276eaa2

Browse files
authored
Merge pull request #1698 from lzutao/non-msvc-wmemchr
Remove MSVC's wmemchr declaration
2 parents 39f43b5 + 0327cc0 commit 276eaa2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/windows/gnu/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ extern "C" {
1313
s2: *const ::c_char,
1414
n: ::size_t,
1515
) -> ::c_int;
16+
17+
// NOTE: For MSVC target, `wmemchr` is only a inline function in `<wchar.h>`
18+
// header file. We cannot find a way to link to that symbol from Rust.
19+
pub fn wmemchr(
20+
cx: *const ::wchar_t,
21+
c: ::wchar_t,
22+
n: ::size_t,
23+
) -> *mut ::wchar_t;
1624
}
1725

1826
cfg_if! {

src/windows/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ extern "C" {
378378
) -> ::size_t;
379379

380380
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
381-
pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
382381
pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
383382
pub fn memcpy(
384383
dest: *mut c_void,

0 commit comments

Comments
 (0)