Crates.io | c_macros |
lib.rs | c_macros |
version | 0.1.1 |
source | src |
created_at | 2020-02-11 20:57:06.080152 |
updated_at | 2020-02-11 21:15:25.849997 |
description | A bunch of macros useful for interfacing with C code |
homepage | |
repository | https://github.com/NonNullableName/c_macros |
max_upload_size | |
id | 207449 |
size | 9,373 |
This library provide a bunch of macros useful for interacting with C code.
All alternatives are performant as possible,in particular to_raw_c_string("Hello world!")
does not
convert a vector into a boxed slice as CString::from_vec_unchecked(String::from("Hello world!").into_bytes()).into_raw()
does.
As such,because they use byte literal syntax at the expansion,all are safe abstractions and does not need an unsafe block neither trigger warnings if are inside of one.
This library require a nightly compiler with the following features enabled: proc_macro_hygiene because the macros are only useful expanded as expressions,new_uninit and type_ascription for to_raw_c_string.