genco::lang::c

Function include_system

Source
pub fn include_system<M, N>(path: M, item: N) -> Import
where M: Into<ItemStr>, N: Into<ItemStr>,
Expand description

Include an item declared in a C system header such as #include <stdio.h>.

ยงExamples

use genco::prelude::*;

let printf = c::include_system("stdio.h", "printf");

let printf_toks = quote! {
    $printf
};

assert_eq!(
    vec![
       "#include <stdio.h>",
       "",
       "printf",
    ],
    printf_toks.to_file_vec()?
);