relibc: add missing float.h macros (LDBL_DIG, DECIMAL_DIG, FLT_EVAL_METHOD); add getprogname(); fix pthread unused assignment warning
This commit is contained in:
@@ -41,6 +41,9 @@ after_includes = """
|
||||
#define LDBL_HAS_SUBNORM 1
|
||||
#define LDBL_DECIMAL_DIG DECIMAL_DIG
|
||||
|
||||
#define FLT_EVAL_METHOD 0
|
||||
#define DECIMAL_DIG 21
|
||||
|
||||
// TODO: Support more architectures than x86_64 here:
|
||||
#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
|
||||
#define LDBL_MIN 3.3621031431120935063e-4932L
|
||||
@@ -50,6 +53,9 @@ after_includes = """
|
||||
#define LDBL_MANT_DIG 64
|
||||
#define LDBL_MIN_EXP (-16381)
|
||||
#define LDBL_MAX_EXP 16384
|
||||
#define LDBL_DIG 18
|
||||
#define LDBL_MIN_10_EXP (-4931)
|
||||
#define LDBL_MAX_10_EXP 4932
|
||||
|
||||
#endif // _RELIBC_BITS_FLOAT_H
|
||||
"""
|
||||
|
||||
@@ -57,6 +57,12 @@ pub const MB_CUR_MAX: c_int = 4;
|
||||
//Maximum number of bytes in a multibyte characters for any locale
|
||||
pub const MB_LEN_MAX: c_int = 4;
|
||||
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/getprogname.html>.
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn getprogname() -> *const c_char {
|
||||
unsafe { platform::program_invocation_short_name }
|
||||
}
|
||||
|
||||
static ATEXIT_FUNCS: RawCell<[Option<extern "C" fn()>; 32]> = RawCell::new([None; 32]);
|
||||
static AT_QUICK_EXIT_FUNCS: RawCell<[Option<extern "C" fn()>; 32]> = RawCell::new([None; 32]);
|
||||
static L64A_BUFFER: RawCell<[c_char; 7]> = RawCell::new([0; 7]); // up to 6 digits plus null terminator
|
||||
|
||||
+4
-5
@@ -121,12 +121,11 @@ pub(crate) unsafe fn create(
|
||||
) -> Result<pthread_t, Errno> {
|
||||
let attrs = attrs.cloned().unwrap_or_default();
|
||||
|
||||
let mut current_sigmask = 0_u64;
|
||||
#[cfg(target_os = "redox")]
|
||||
{
|
||||
current_sigmask =
|
||||
redox_rt::signal::get_sigmask().expect("failed to obtain sigprocmask for caller");
|
||||
}
|
||||
let current_sigmask =
|
||||
redox_rt::signal::get_sigmask().expect("failed to obtain sigprocmask for caller");
|
||||
#[cfg(not(target_os = "redox"))]
|
||||
let current_sigmask = 0_u64;
|
||||
|
||||
// Create a locked mutex, unlocked by the thread after it has started.
|
||||
let synchronization_mutex = unsafe { Mutex::locked(current_sigmask) };
|
||||
|
||||
Reference in New Issue
Block a user