-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove limb_width32 and limb_width64 features"
This reverts commit c754f03.
- Loading branch information
Showing
5 changed files
with
73 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use std::env; | ||
use std::process::Command; | ||
use std::str::{self, FromStr}; | ||
|
||
fn main() { | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
|
||
// Decide ideal limb width for arithmetic in the float parser. Refer to | ||
// src/lexical/math.rs for where this has an effect. | ||
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); | ||
match target_arch.as_str() { | ||
"aarch64" | "mips64" | "powerpc64" | "x86_64" => { | ||
println!("cargo:rustc-cfg=limb_width_64"); | ||
} | ||
_ => { | ||
println!("cargo:rustc-cfg=limb_width_32"); | ||
} | ||
} | ||
|
||
let minor = match rustc_minor_version() { | ||
Some(minor) => minor, | ||
None => return, | ||
}; | ||
} | ||
|
||
fn rustc_minor_version() -> Option<u32> { | ||
let rustc = env::var_os("RUSTC")?; | ||
let output = Command::new(rustc).arg("--version").output().ok()?; | ||
let version = str::from_utf8(&output.stdout).ok()?; | ||
let mut pieces = version.split('.'); | ||
if pieces.next() != Some("rustc 1") { | ||
return None; | ||
} | ||
let next = pieces.next()?; | ||
u32::from_str(next).ok() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters