aboutsummaryrefslogtreecommitdiff
path: root/vendor/num-traits/build.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-01-08 00:21:28 +0300
committerValentin Popov <valentin@popov.link>2024-01-08 00:21:28 +0300
commit1b6a04ca5504955c571d1c97504fb45ea0befee4 (patch)
tree7579f518b23313e8a9748a88ab6173d5e030b227 /vendor/num-traits/build.rs
parent5ecd8cf2cba827454317368b68571df0d13d7842 (diff)
downloadfparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.tar.xz
fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.zip
Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
Diffstat (limited to 'vendor/num-traits/build.rs')
-rw-r--r--vendor/num-traits/build.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/num-traits/build.rs b/vendor/num-traits/build.rs
new file mode 100644
index 0000000..bb78328
--- /dev/null
+++ b/vendor/num-traits/build.rs
@@ -0,0 +1,24 @@
+use std::env;
+
+fn main() {
+ let ac = autocfg::new();
+
+ ac.emit_expression_cfg(
+ "unsafe { 1f64.to_int_unchecked::<i32>() }",
+ "has_to_int_unchecked",
+ );
+
+ ac.emit_expression_cfg("1u32.reverse_bits()", "has_reverse_bits");
+ ac.emit_expression_cfg("1u32.trailing_ones()", "has_leading_trailing_ones");
+ ac.emit_expression_cfg("1u32.div_euclid(1u32)", "has_div_euclid");
+
+ if env::var_os("CARGO_FEATURE_STD").is_some() {
+ ac.emit_expression_cfg("1f64.copysign(-1f64)", "has_copysign");
+ }
+ ac.emit_expression_cfg("1f64.is_subnormal()", "has_is_subnormal");
+
+ ac.emit_expression_cfg("1u32.to_ne_bytes()", "has_int_to_from_bytes");
+ ac.emit_expression_cfg("3.14f64.to_ne_bytes()", "has_float_to_from_bytes");
+
+ autocfg::rerun_path("build.rs");
+}