24 lines
407 B
Rust
24 lines
407 B
Rust
// 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),+,
|
|
}
|
|
};
|
|
}
|