From e2604a756aaddcd5919ee2f1b9cc0055d200f846 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Mon, 10 Dec 2018 21:00:27 -0800 Subject: Update libc crate to 0.2.45 This change updates the libc crate to version 0.2.45. Import subrepo libc/:libc at f5636fc618f8e16968b3178196d73c94ad9f7b05 --- libc/src/macros.rs | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'libc/src/macros.rs') 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: [], + }; + )*) } -- cgit v1.2.1