Patch up foreign-fn-linkname.rs
This commit is contained in:
parent
281178de42
commit
70147cd3ab
@ -1,20 +1,14 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-sgx no libc
|
//@ ignore-sgx no libc
|
||||||
|
|
||||||
// Ensure no false positive on "unused extern crate" lint
|
|
||||||
#![deny(unused_extern_crates)]
|
|
||||||
|
|
||||||
#![feature(rustc_private)]
|
|
||||||
|
|
||||||
extern crate libc;
|
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
|
|
||||||
mod mlibc {
|
mod mlibc {
|
||||||
use libc::{c_char, size_t};
|
use std::ffi::c_char;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#[link_name = "strlen"]
|
#[link_name = "strlen"]
|
||||||
pub fn my_strlen(str: *const c_char) -> size_t;
|
pub fn my_strlen(str: *const c_char) -> usize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ mod zed {
|
|||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
mod mlibc {
|
mod mlibc {
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
use libc::{c_int, c_void, size_t, ssize_t};
|
use self::libc::{c_int, c_void, size_t, ssize_t};
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
|
pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user