Skip to content

Commit ff0ca7d

Browse files
committed
Declare memmem on macOS
1 parent af64038 commit ff0ca7d

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
@@ -4095,6 +4095,19 @@ extern "C" {
40954095
pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int;
40964096
}
40974097

4098+
cfg_if! {
4099+
if #[cfg(target_os = "macos")] {
4100+
extern "C" {
4101+
pub fn memmem(
4102+
haystack: *const ::c_void,
4103+
haystacklen: ::size_t,
4104+
needle: *const ::c_void,
4105+
needlelen: ::size_t,
4106+
) -> *mut ::c_void;
4107+
}
4108+
}
4109+
}
4110+
40984111
#[link(name = "iconv")]
40994112
extern "C" {
41004113
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;

0 commit comments

Comments
 (0)