Files
binding/src/c_struct.rs
Myrddin Dundragon 96b58aed43 Added Licensing.
This added the new License and stamped all the files with it.
2025-07-29 12:59:33 -04:00

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),+,
}
};
}