Merge branch 'verify-monetary-includes' into 'master'

verify monetary header includes

See merge request redox-os/relibc!1193
This commit is contained in:
Jeremy Soller
2026-04-14 07:13:18 -06:00
2 changed files with 13 additions and 4 deletions
+12 -4
View File
@@ -1,5 +1,16 @@
sys_includes = ["stddef.h", "stdint.h", "features.h"]
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/monetary.h.html
#
# Spec quotations relating to includes:
# - "The <monetary.h> header shall define the locale_t type as described in <locale.h>."
# - "The <monetary.h> header shall define the size_t type as described in <stddef.h>."
# - "The <monetary.h> header shall define the ssize_t type as described in <sys/types.h>."
#
# sys/types.h brings in stddef.h
sys_includes = ["sys/types.h"]
include_guard = "_RELIBC_MONETARY_H"
after_includes = """
#include <bits/locale-t.h> // for locale_t from locale.h
"""
language = "C"
style = "tag"
no_includes = true
@@ -7,6 +18,3 @@ cpp_compat = true
[enum]
prefix_with_name = true
+1
View File
@@ -14,6 +14,7 @@ use libm::{fabs, pow, round, trunc};
/// Returns:
/// - The number of characters written (excluding the null terminator), or -1 if
/// an error occurs (e.g., invalid input, buffer overflow)
#[unsafe(no_mangle)]
pub unsafe extern "C" fn strfmon(
s: *mut c_char, // Output buffer
maxsize: usize, // Maximum size of the buffer