| 1 |
use crate::prelude::*; |
| 2 |
|
| 3 |
// The below configuration for machines with 32-bit word size aligns with the |
| 4 |
// declaration in the `mingw-w64` headers. |
| 5 |
cfg_if! { |
| 6 |
if #[cfg(target_pointer_width = "64")] { |
| 7 |
s_no_extra_traits! { |
| 8 |
#[repr(align(16))] |
| 9 |
pub struct max_align_t { |
| 10 |
priv_: [f64; 4], |
| 11 |
} |
| 12 |
} |
| 13 |
} else if #[cfg(target_pointer_width = "32")] { |
| 14 |
s_no_extra_traits! { |
| 15 |
#[repr(align(8))] |
| 16 |
pub struct max_align_t { |
| 17 |
priv_: [i64; 3], |
| 18 |
} |
| 19 |
} |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
// stdio file descriptor numbers |
| 24 |
pub const STDIN_FILENO: c_int = 0; |
| 25 |
pub const STDOUT_FILENO: c_int = 1; |
| 26 |
pub const STDERR_FILENO: c_int = 2; |
| 27 |
|
| 28 |
extern "C" { |
| 29 |
pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; |
| 30 |
pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; |
| 31 |
|
| 32 |
// NOTE: For MSVC target, `wmemchr` is only a inline function in `<wchar.h>` |
| 33 |
// header file. We cannot find a way to link to that symbol from Rust. |
| 34 |
pub fn wmemchr(cx: *const crate::wchar_t, c: crate::wchar_t, n: size_t) -> *mut crate::wchar_t; |
| 35 |
} |