From bf7e77b836bf72380b6a21d4125b5772db800fd0 Mon Sep 17 00:00:00 2001 From: auronandace Date: Wed, 22 Apr 2026 11:40:16 +0100 Subject: [PATCH] verify strings header includes --- src/header/strings/cbindgen.toml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/header/strings/cbindgen.toml b/src/header/strings/cbindgen.toml index 5f974357c2..4479f685d6 100644 --- a/src/header/strings/cbindgen.toml +++ b/src/header/strings/cbindgen.toml @@ -1,9 +1,22 @@ -sys_includes = ["features.h", "stddef.h", "stdint.h"] +# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/strings.h.html +# +# Spec quotations relating to includes: +# - "The header shall define the locale_t type as described in ." +# - "The header shall define the size_t type as described in ." +# +# sys/types.h gets size_t from stddef.h (just include stddef.h here instead of importing all of sys/types.h) +# features.h required for deprecated annotations +sys_includes = ["features.h", "stddef.h"] include_guard = "_RELIBC_STRINGS_H" +after_includes = """ +#include // for locale_t from locale.h +""" language = "C" style = "Tag" no_includes = true cpp_compat = true +# make size_t actually size_t instead of uintptr_t (which would require stdint.h) +usize_is_size_t = true [enum] prefix_with_name = true