Skip to content

Commit

Permalink
Explicitly check target_pointer_width.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Oct 21, 2023
1 parent 54716cd commit 15c0c83
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions all-is-cubes/src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ pub use rotation::*;
mod vol;
pub use vol::*;

// We make an assumption in several places that `usize` is at least 32 bits.
// It's likely that compilation would not succeed anyway, but let's make it explicit.
#[cfg(not(any(
target_pointer_width = "32",
target_pointer_width = "64",
target_pointer_width = "128",
)))]
compile_error!("all-is-cubes does not support platforms with less than 32-bit `usize`");

/// Allows writing a [`NotNan`] value as a constant expression (which is not currently
/// a feature provided by the [`ordered_float`] crate itself).
///
Expand Down

0 comments on commit 15c0c83

Please sign in to comment.