This patch looks good to me overall, it's a nice improvement in clarity.
On 26.10.25 20:43, Jeff Davis wrote:
+/* + * char16_t and char32_t + * Unicode code points. + */ +#ifndef __cplusplus +#ifdef HAVE_UCHAR_H +#include <uchar.h> +#ifndef __STDC_UTF_16__ +#error "char16_t must use UTF-16 encoding" +#endif +#ifndef __STDC_UTF_32__ +#error "char32_t must use UTF-32 encoding" +#endif +#else +typedef uint16_t char16_t; +typedef uint32_t char32_t; +#endif +#endif
This could be improved a bit. The reason for some of these conditionals is not clear. Like, what does __cplusplus have to do with this? I think it would be more correct to write a configure/meson check for the actual types rather than depend indirectly on a header check.
The checks for __STDC_UTF_16__ and __STDC_UTF_32__ can be removed, as was discussed elsewhere, since we don't use any standard library functions that make use of these facts, and the need goes away with C23 anyway.
