macro_rules! check_misalign4 {
($ptr:expr) => { ... };
}Expand description
Checks that an address is aligned to a 4 byte bound.
If the result is non-zero, that’s how many bytes past the most recent 4 byte bound you are.
#[macro_use]
extern crate retro_pixel;
fn main() {
for x in 0 .. 100 {
assert_eq!(check_misalign4!(x), x % 4);
}
}