摘要: 1、示例:对不同的操作系统调用不同的代码。 use libc; #[cfg(target_os="linux")] fn my_print(){ unsafe{ libc::printf("hello".as_ptr() as *const libc::c_char); } } #[cfg(targ 阅读全文
posted @ 2020-04-24 15:06 gelare 阅读(3041) 评论(0) 推荐(2) 编辑