Status: works, v0.1.9

What's this?

Meet c_rs. It is a fork of no longer maintained project.

This crate lets you write C code directly inside Rust.

GCC and rustc nightly are required!

So how do I use it?

Specify your Cargo.toml with ```toml [build-dependencies.crs] git = "https://github.com/mrMiiao/crs" version = "*" features = ["build"]

[dependencies.crs] git = "https://github.com/mrMiiao/crs" version = "*" features = ["macro"] And put this to Build.rs rust extern crate crs; fn main() { crs::build("src/main.rs", "cratename", |cfg| { // cfg is a gcc::Config object. You can use it to add additional // configuration options to the invocation of the C compiler. }); } Example of main.rs rust extern crate crs; use crs::c; use crs::ctypes::_void;

c!{ #include raw{ void hello_world() { puts("Hello, World!"); } } }

extern "C" { fn hello_world() -> _void; }

fn main() { unsafe{ hello_world(); } } ``` You can find more examples here

Goals: