Rust #![no_std]世界,您好!
示例
#![feature(start, libc, lang_items)]
#![no_std]
#![no_main]
//libccrate允许从C导入函数。
extern crate libc;
//导入的C函数列表
extern {
pub fn printf(format: *const u8, ...) -> i32;
}
#[no_mangle]
//主函数,其输入参数被忽略,并返回退出状态
pub extern fn main(_nargs: i32, _args: *const *const u8) -> i32 {
// Print "Hello, World" to stdout using printf
unsafe {
printf(b"Hello, World!\n" as *const u8);
}
//退出,返回状态为0。
0
}
#[lang = "eh_personality"] extern fn eh_personality() {}
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { panic!() }
热门推荐
1 泰迪狗狗如何训练
3 狗狗训练图
5 狗狗训练方法
6 训练狗狗不咬人
8 敏捷训练狗狗
10 训练狗狗吃饭
11 泰迪狗狗训练
12 狗狗从多大开始训练
13 狗狗训练学校费用
14 怎么去训练狗狗
15 狗狗训练狗狗
16 狗狗训练教程
17 训练狗狗装死
18 泰迪狗狗的训练方法