From 895c58673613b1c2cc30022c88cca5873fba2d8d Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 8 Aug 2026 05:43:34 +0300 Subject: [PATCH] LibC: Add uchar.h This was added in POSIX issue 8 and some ports end up with very weird compile errors if this does not exist :D --- userspace/libraries/LibC/include/uchar.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 userspace/libraries/LibC/include/uchar.h diff --git a/userspace/libraries/LibC/include/uchar.h b/userspace/libraries/LibC/include/uchar.h new file mode 100644 index 00000000..db45545f --- /dev/null +++ b/userspace/libraries/LibC/include/uchar.h @@ -0,0 +1,21 @@ +#ifndef _UCHAR_H +#define _UCHAR_H 1 + +// https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/uchar.h.html + +#include + +__BEGIN_DECLS + +#include +#include +#include + +size_t c16rtomb(char* __restrict__ s, char16_t c16, mbstate_t* __restrict__ ps); +size_t c32rtomb(char* __restrict__ s, char32_t c32, mbstate_t* __restrict__ ps); +size_t mbrtoc16(char16_t* __restrict__ pc16, const char* __restrict__ s, size_t n, mbstate_t* __restrict__ ps); +size_t mbrtoc32(char32_t* __restrict__ pc32, const char* __restrict__ s, size_t n, mbstate_t* __restrict__ ps); + +__END_DECLS + +#endif