Files
binding/src/c_struct.rs

24 lines
407 B
Rust
Raw Normal View History

// SPDX-License-Identifier: Apache-2.0
// Sealed with Magistamp.
/// Defines a C style structure.
#[macro_export]
macro_rules! c_struct
{
{
$(#[$sattr: meta])*
$cname: ident
{
$($(#[$attr: meta])* $name: ident: $type: ty);*;
}
} =>
{
$(#[$sattr])*
#[repr(C)]
pub struct $cname
{
$($(#[$attr])* pub $name: $type),+,
}
};
}