Browse Source

Don't use an explicit copysign feature

Josh Stone 3 years ago
parent
commit
30077120f9
2 changed files with 4 additions and 5 deletions
  1. 0 1
      Cargo.toml
  2. 4 4
      build.rs

+ 0 - 1
Cargo.toml

@@ -23,7 +23,6 @@ libm = { version = "0.2.0", optional = true }
 default = ["std"]
 std = []
 i128 = []
-copysign = []
 
 [build-dependencies]
 autocfg = "1"

+ 4 - 4
build.rs

@@ -11,10 +11,6 @@ fn main() {
         autocfg::emit("has_i128");
     }
 
-    if env::var_os("CARGO_FEATURE_COPYSIGN").is_some() || ac.probe_expression("f32::copysign") {
-        autocfg::emit("has_copysign");
-    }
-
     ac.emit_expression_cfg(
         "unsafe { 1f64.to_int_unchecked::<i32>() }",
         "has_to_int_unchecked",
@@ -25,5 +21,9 @@ fn main() {
     ac.emit_expression_cfg("{ let mut x = 1; x += &2; }", "has_int_assignop_ref");
     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");
+    }
+
     autocfg::rerun_path("build.rs");
 }