1 | use std::env; |
2 | |
3 | fn main() { |
4 | let ac = autocfg::new(); |
5 | |
6 | ac.emit_expression_cfg( |
7 | "unsafe { 1f64.to_int_unchecked::<i32>() }" , |
8 | "has_to_int_unchecked" , |
9 | ); |
10 | |
11 | ac.emit_expression_cfg("1u32.reverse_bits()" , "has_reverse_bits" ); |
12 | ac.emit_expression_cfg("1u32.trailing_ones()" , "has_leading_trailing_ones" ); |
13 | ac.emit_expression_cfg("1u32.div_euclid(1u32)" , "has_div_euclid" ); |
14 | |
15 | if env::var_os("CARGO_FEATURE_STD" ).is_some() { |
16 | ac.emit_expression_cfg("1f64.copysign(-1f64)" , "has_copysign" ); |
17 | } |
18 | ac.emit_expression_cfg("1f64.is_subnormal()" , "has_is_subnormal" ); |
19 | |
20 | ac.emit_expression_cfg("1u32.to_ne_bytes()" , "has_int_to_from_bytes" ); |
21 | ac.emit_expression_cfg("3.14f64.to_ne_bytes()" , "has_float_to_from_bytes" ); |
22 | |
23 | autocfg::rerun_path("build.rs" ); |
24 | } |
25 | |