2019-06-25 02:31:18 -04:00
|
|
|
/// Defines a C style structure.
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! c_struct
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$cname: ident
|
|
|
|
{
|
2019-06-25 03:17:05 -04:00
|
|
|
$($(#[$attr: meta])* $name: ident: $type: ty);*;
|
2019-06-25 02:31:18 -04:00
|
|
|
}
|
|
|
|
} =>
|
|
|
|
{
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct $cname
|
|
|
|
{
|
2019-06-25 03:17:05 -04:00
|
|
|
$($(#[$attr])* pub $name: $type),+,
|
2019-06-25 02:31:18 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|