libc: Add WCHAR_WIDTH in <wchar.h> as well

Define __WCHAR_WIDTH in sys/_types.h and derive WCHAR_WIDTH from
that, the same way as WCHAR_MIN and WCHAR_MAX, in both <wchar.h>
and <stdint.h> as per C23 §7.31.1 and §7.22.3.4, respectively.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D59385
This commit is contained in:
Faraz Vahedi committed 2026-09-05 14:11:22 +03:30
1 parent 733ea4ee58
commit 72ed6f9c9d
8 files changed
+8 -5

No files matched your search

+3
View File
@@ -97,6 +97,9 @@ typedef __wint_t wint_t;
#define WCHAR_MIN __WCHAR_MIN
#define WCHAR_MAX __WCHAR_MAX
#if __ISO_C_VISIBLE >= 2023
#define WCHAR_WIDTH __WCHAR_WIDTH
#endif
#ifndef WEOF
#define WEOF ((wint_t)-1)