Can you just put a configuration conditional block to check the architecture you are using? Create a type alias which is then set to either usize or u32. That way you could leave all type annotations as your aliased type regardless of the architecture.