blob: 816ddadd721196a1c9838daa01e31c9844fc9046 [file] [log] [blame]
Joel Galensona92be9e2020-08-05 11:56:59 -07001extern crate autocfg;
2
3use std::env;
4
5fn main() {
6 let ac = autocfg::new();
Haibo Huangfa1e1282020-10-29 19:19:23 -07007
8 // If the "i128" feature is explicity requested, don't bother probing for it.
9 // It will still cause a build error if that was set improperly.
10 if env::var_os("CARGO_FEATURE_I128").is_some() || ac.probe_type("i128") {
11 autocfg::emit("has_i128");
Joel Galensona92be9e2020-08-05 11:56:59 -070012 }
Haibo Huangfa1e1282020-10-29 19:19:23 -070013
Joel Galensona92be9e2020-08-05 11:56:59 -070014 ac.emit_expression_cfg(
15 "unsafe { 1f64.to_int_unchecked::<i32>() }",
16 "has_to_int_unchecked",
17 );
18
19 autocfg::rerun_path("build.rs");
20}