Convert strtold to Rust

This commit is contained in:
Wildan M
2025-12-25 16:11:36 +07:00
parent d82db81ae2
commit 08485648f6
6 changed files with 10 additions and 42 deletions
+3
View File
@@ -6,5 +6,8 @@ style = "Type"
no_includes = true
cpp_compat = true
[export.rename]
"c_longdouble" = "long double"
[enum]
prefix_with_name = true
+5 -1
View File
@@ -1479,7 +1479,11 @@ pub unsafe extern "C" fn strtol(s: *const c_char, endptr: *mut *mut c_char, base
)
}
// TODO: strtold(), when long double is available
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/strtold.html>.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn strtold(s: *const c_char, endptr: *mut *mut c_char) -> c_longdouble {
strto_float_impl!(c_longdouble, s, endptr)
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/strtol.html>.
#[unsafe(no_mangle)]