#[macro_export]
macro_rules! byte_set {
($($byte:expr,)*) => {
$crate::ByteSet::new() $(.inserting($byte))*
};
($($byte:expr),*) => {
$crate::byte_set!($($byte,)*)
};
}
macro_rules! map_reduce_chunks {
($this:expr, $other:expr, $map:tt, $reduce:tt) => {{
#[cfg(target_pointer_width = "64")]
{
($this.0[0] $map $other.0[0]) $reduce
($this.0[1] $map $other.0[1]) $reduce
($this.0[2] $map $other.0[2]) $reduce
($this.0[3] $map $other.0[3])
}
#[cfg(not(target_pointer_width = "64"))]
{
($this.0[0] $map $other.0[0]) $reduce
($this.0[1] $map $other.0[1]) $reduce
($this.0[2] $map $other.0[2]) $reduce
($this.0[3] $map $other.0[3]) $reduce
($this.0[4] $map $other.0[4]) $reduce
($this.0[5] $map $other.0[5]) $reduce
($this.0[6] $map $other.0[6]) $reduce
($this.0[7] $map $other.0[7])
}
}};
}
macro_rules! map_chunks {
($this:expr, $map:tt) => {{
#[cfg(target_pointer_width = "64")]
{
ByteSet([
$map $this.0[0], $map $this.0[1],
$map $this.0[2], $map $this.0[3],
])
}
#[cfg(not(target_pointer_width = "64"))]
{
ByteSet([
$map $this.0[0], $map $this.0[1],
$map $this.0[2], $map $this.0[3],
$map $this.0[4], $map $this.0[5],
$map $this.0[6], $map $this.0[7],
])
}
}};
($this:expr, $map:tt, $other:expr) => {{
#[cfg(target_pointer_width = "64")]
{
ByteSet([
($this.0[0] $map $other.0[0]), ($this.0[1] $map $other.0[1]),
($this.0[2] $map $other.0[2]), ($this.0[3] $map $other.0[3]),
])
}
#[cfg(not(target_pointer_width = "64"))]
{
ByteSet([
($this.0[0] $map $other.0[0]), ($this.0[1] $map $other.0[1]),
($this.0[2] $map $other.0[2]), ($this.0[3] $map $other.0[3]),
($this.0[4] $map $other.0[4]), ($this.0[5] $map $other.0[5]),
($this.0[6] $map $other.0[6]), ($this.0[7] $map $other.0[7]),
])
}
}};
}