verify monetary header includes

This commit is contained in:
auronandace
2026-04-14 11:00:25 +01:00
parent 022f040f05
commit 09fe8e29c3
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