Skip to content

Commit 9bf70c4

Browse files
committed
Auto merge of #2208 - JohnTitor:memmem-macos, r=Amanieu
Declare `memmem` on macOS Closes #2181
2 parents 1d51906 + ff0ca7d commit 9bf70c4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libc-test/semver/macos.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
memmem

src/unix/bsd/apple/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,6 +4100,19 @@ extern "C" {
41004100
pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int;
41014101
}
41024102

4103+
cfg_if! {
4104+
if #[cfg(target_os = "macos")] {
4105+
extern "C" {
4106+
pub fn memmem(
4107+
haystack: *const ::c_void,
4108+
haystacklen: ::size_t,
4109+
needle: *const ::c_void,
4110+
needlelen: ::size_t,
4111+
) -> *mut ::c_void;
4112+
}
4113+
}
4114+
}
4115+
41034116
#[link(name = "iconv")]
41044117
extern "C" {
41054118
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;

0 commit comments

Comments
 (0)