diff --git a/build.rs b/build.rs index f1b0a3046..6284b7e3e 100644 --- a/build.rs +++ b/build.rs @@ -192,9 +192,9 @@ fn has_small_stack(_: &Target) -> Result> { // build.rs is executed on the main thread, so we are getting the main thread's stack size. // Modern macOS versions default to an 8 MiB main stack but legacy OS X have a 0.5 MiB one. let stack_size = unsafe { pthread_get_stacksize_np(pthread_self()) }; - const TWO_MIB: usize = 2 * 1024 * 1024; + const TWO_MIB: usize = 2 * 1024 * 1024 - 1; match stack_size { - 0..TWO_MIB => Ok(true), + 0..=TWO_MIB => Ok(true), _ => Ok(false), } }