diff options
author | Daniel Mueller <deso@posteo.net> | 2018-12-10 21:00:27 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2018-12-10 21:00:27 -0800 |
commit | e2604a756aaddcd5919ee2f1b9cc0055d200f846 (patch) | |
tree | 1ea1b9900db20d3aadbddbce18882d0c957247d7 /libc/src/macros.rs | |
parent | 5875df6c958743cf86c75b2cb5fc2efe5ca0de43 (diff) | |
download | nitrocli-e2604a756aaddcd5919ee2f1b9cc0055d200f846.tar.gz nitrocli-e2604a756aaddcd5919ee2f1b9cc0055d200f846.tar.bz2 |
Update libc crate to 0.2.45
This change updates the libc crate to version 0.2.45.
Import subrepo libc/:libc at f5636fc618f8e16968b3178196d73c94ad9f7b05
Diffstat (limited to 'libc/src/macros.rs')
-rw-r--r-- | libc/src/macros.rs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/libc/src/macros.rs b/libc/src/macros.rs index 8429442..7720578 100644 --- a/libc/src/macros.rs +++ b/libc/src/macros.rs @@ -35,11 +35,11 @@ macro_rules! __cfg_if_apply { } macro_rules! s { - ($($(#[$attr:meta])* pub struct $i:ident { $($field:tt)* })*) => ($( + ($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($( __item! { #[repr(C)] $(#[$attr])* - pub struct $i { $($field)* } + pub $t $i { $($field)* } } impl ::dox::Copy for $i {} impl ::dox::Clone for $i { @@ -48,17 +48,18 @@ macro_rules! s { )*) } +#[allow(unused_macros)] macro_rules! f { ($(pub fn $i:ident($($arg:ident: $argty:ty),*) -> $ret:ty { $($body:stmt);* })*) => ($( #[inline] - #[cfg(not(dox))] + #[cfg(not(cross_platform_docs))] pub unsafe extern fn $i($($arg: $argty),*) -> $ret { $($body);* } - #[cfg(dox)] + #[cfg(cross_platform_docs)] #[allow(dead_code)] pub unsafe extern fn $i($($arg: $argty),*) -> $ret { loop {} @@ -67,5 +68,24 @@ macro_rules! f { } macro_rules! __item { - ($i:item) => ($i) + ($i:item) => { + $i + }; +} + +#[allow(unused_macros)] +macro_rules! align_const { + ($($(#[$attr:meta])* pub const $name:ident : $t1:ty = $t2:ident { $($field:tt)* };)*) => ($( + #[cfg(feature = "align")] + $(#[$attr])* + pub const $name : $t1 = $t2 { + $($field)* + }; + #[cfg(not(feature = "align"))] + $(#[$attr])* + pub const $name : $t1 = $t2 { + $($field)* + __align: [], + }; + )*) } |