jD91mZM2 6 роки тому
батько
коміт
b0546336c7
3 змінених файлів з 6 додано та 2 видалено
  1. 1 0
      include/math.h
  2. 3 1
      src/stdlib/src/lib.rs
  3. 2 1
      src/time/src/constants.rs

+ 1 - 0
include/math.h

@@ -1,3 +1,4 @@
 #define OPENLIBM_USE_HOST_FENV_H 1
 #include <openlibm.h>
 #undef I
+#undef complex

+ 3 - 1
src/stdlib/src/lib.rs

@@ -728,7 +728,9 @@ pub fn convert_integer(s: *const c_char, base: c_int) -> Option<(c_ulong, isize,
     let mut overflowed = false;
 
     loop {
-        let val = unsafe { LOOKUP_TABLE[*s.offset(idx) as usize] };
+        // `-1 as usize` is -1
+        // `-1 as u8 as usize` is 255
+        let val = unsafe { LOOKUP_TABLE[*s.offset(idx) as u8 as usize] };
         if val == -1 || val as c_int >= base {
             break;
         } else {

+ 2 - 1
src/time/src/constants.rs

@@ -48,4 +48,5 @@ pub const CLOCK_MONOTONIC: clockid_t = 1;
 pub(crate) const CLOCK_PROCESS_CPUTIME_ID: clockid_t = 2;
 pub(crate) const CLOCK_THREAD_CPUTIME_ID: clockid_t = 3;
 
-pub(crate) const CLOCKS_PER_SEC: time_t = 1_000_000;
+// Can't be time_t because cbindgen UGH
+pub(crate) const CLOCKS_PER_SEC: c_long = 1_000_000;