diff options
author | bors <bors@rust-lang.org> | 2021-06-03 21:28:53 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2021-06-03 21:28:53 +0000 |
commit | 9bf70c40799bda360f4ae0689a8fa4421e5a8d67 (patch) | |
tree | 3cd1005ea2c4562a8bf88619e4a3b5ef68154fe8 | |
parent | 1d5190618101005058d8d0e3eb8fd1e990be6882 (diff) | |
parent | ff0ca7d1b1f784beee614f4f4a82be7ddf353b35 (diff) | |
download | rust-libc-9bf70c40799bda360f4ae0689a8fa4421e5a8d67.tar.gz |
Auto merge of #2208 - JohnTitor:memmem-macos, r=Amanieu
Declare `memmem` on macOS
Closes #2181
-rw-r--r-- | libc-test/semver/macos.txt | 1 | ||||
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libc-test/semver/macos.txt b/libc-test/semver/macos.txt new file mode 100644 index 0000000000..d6a91320b8 --- /dev/null +++ b/libc-test/semver/macos.txt @@ -0,0 +1 @@ +memmem diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 8449e9a1f0..bbab89ed61 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -4100,6 +4100,19 @@ extern "C" { pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int; } +cfg_if! { + if #[cfg(target_os = "macos")] { + extern "C" { + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + } + } +} + #[link(name = "iconv")] extern "C" { pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; |