summaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
authorBryant Mairs <bryant@mai.rs>2017-08-09 09:32:56 -0700
committerBryant Mairs <bryant@mai.rs>2017-08-16 19:36:51 -0700
commiteabdced459c0108613db8363d3ed76e9fd966565 (patch)
tree26532fde8adf0ad575e275bbd75d00ab685acfb1 /src/macros.rs
parentf067e73bdbb589a0e3c991eab2c26de8bb00e924 (diff)
downloadnix-eabdced459c0108613db8363d3ed76e9fd966565.zip
Match libc_bitflags! syntax to upstream bitflags!
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/macros.rs b/src/macros.rs
index d8284f71..7a0eb07c 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -7,15 +7,15 @@
/// # Example
/// ```
/// libc_bitflags!{
-/// pub flags ProtFlags: libc::c_int {
-/// PROT_NONE,
-/// PROT_READ,
-/// PROT_WRITE,
-/// PROT_EXEC,
+/// pub struct ProtFlags: libc::c_int {
+/// PROT_NONE;
+/// PROT_READ;
+/// PROT_WRITE;
+/// PROT_EXEC;
/// #[cfg(any(target_os = "linux", target_os = "android"))]
-/// PROT_GROWSDOWN,
+/// PROT_GROWSDOWN;
/// #[cfg(any(target_os = "linux", target_os = "android"))]
-/// PROT_GROWSUP,
+/// PROT_GROWSUP;
/// }
/// }
/// ```
@@ -26,14 +26,14 @@
///
/// ```
/// libc_bitflags!{
-/// pub flags SaFlags: libc::c_ulong {
-/// SA_NOCLDSTOP as libc::c_ulong,
-/// SA_NOCLDWAIT,
-/// SA_NODEFER as libc::c_ulong,
-/// SA_ONSTACK,
-/// SA_RESETHAND as libc::c_ulong,
-/// SA_RESTART as libc::c_ulong,
-/// SA_SIGINFO,
+/// pub struct SaFlags: libc::c_ulong {
+/// SA_NOCLDSTOP as libc::c_ulong;
+/// SA_NOCLDWAIT;
+/// SA_NODEFER as libc::c_ulong;
+/// SA_ONSTACK;
+/// SA_RESETHAND as libc::c_ulong;
+/// SA_RESTART as libc::c_ulong;
+/// SA_SIGINFO;
/// }
/// }
/// ```
@@ -49,7 +49,7 @@ macro_rules! libc_bitflags {
) => {
bitflags! {
$($attrs)*
- flags $BitFlags: $T {
+ struct $BitFlags: $T {
$($flags)*
}
}
@@ -132,7 +132,7 @@ macro_rules! libc_bitflags {
}
};
- // Munch last ident if not followed by a comma.
+ // Munch last ident if not followed by a semicolon.
(@accumulate_flags
$prefix:tt,
[$($flags:tt)*];
@@ -164,11 +164,11 @@ macro_rules! libc_bitflags {
}
};
- // Munch an ident; covers terminating comma case.
+ // Munch an ident; covers terminating semicolon case.
(@accumulate_flags
$prefix:tt,
[$($flags:tt)*];
- $flag:ident, $($tail:tt)*
+ $flag:ident; $($tail:tt)*
) => {
libc_bitflags! {
@accumulate_flags
@@ -181,12 +181,12 @@ macro_rules! libc_bitflags {
}
};
- // Munch an ident and cast it to the given type; covers terminating comma
+ // Munch an ident and cast it to the given type; covers terminating semicolon
// case.
(@accumulate_flags
$prefix:tt,
[$($flags:tt)*];
- $flag:ident as $ty:ty, $($tail:tt)*
+ $flag:ident as $ty:ty; $($tail:tt)*
) => {
libc_bitflags! {
@accumulate_flags
@@ -202,7 +202,7 @@ macro_rules! libc_bitflags {
// (non-pub) Entry rule.
(
$(#[$attr:meta])*
- flags $BitFlags:ident: $T:ty {
+ struct $BitFlags:ident: $T:ty {
$($vals:tt)*
}
) => {
@@ -221,7 +221,7 @@ macro_rules! libc_bitflags {
// (pub) Entry rule.
(
$(#[$attr:meta])*
- pub flags $BitFlags:ident: $T:ty {
+ pub struct $BitFlags:ident: $T:ty {
$($vals:tt)*
}
) => {