In file included from /home/thomas/br-test-pkg/br-powerpc-603e-basic-cpp/build/fluent-bit-4.0.0/include/fluent-bit/simdutf/flb_simdutf_connector.h:32, from /home/thomas/br-test-pkg/br-powerpc-603e-basic-cpp/build/fluent-bit-4.0.0/include/fluent-bit/flb_unicode.h:26, from /home/thomas/br-test-pkg/br-powerpc-603e-basic-cpp/build/fluent-bit-4.0.0/plugins/in_tail/tail_file.c:52: /home/thomas/br-test-pkg/br-powerpc-603e-basic-cpp/host/powerpc-buildroot-linux-uclibc/sysroot/usr/include/uchar.h:36:9: error: unknown type name â__mbstate_tâ 36 | typedef __mbstate_t mbstate_t; | ^~~~~~~~~~~
The __mbstate_t type is created in wchar.h, and there, __mbstate_t_defined gets defined, and __need_mbstate_t gets undefined. The mbstate_t type is not created in wchar.h, since __need_mbstate_t is defined in uchar.h. Its not yet clear why __mbstate_t_defined is not defined in uchar.h after the wchar.h include, but the fact is, if it's not, that we can't define mbstate_t.
Signed-off-by: Thomas Devoogdt thomas@devoogdt.com --- Beware that I'm not completly sure about the __mbstate_t_defined and __need_mbstate_t, so please review the patch carefully. --- include/uchar.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/uchar.h b/include/uchar.h index 5e10196d7..58cf1918f 100644 --- a/include/uchar.h +++ b/include/uchar.h @@ -30,12 +30,11 @@ #define __need_mbstate_t #include <wchar.h>
-#ifndef __mbstate_t_defined +#ifdef __mbstate_t_defined __BEGIN_NAMESPACE_C99 /* Public type. */ typedef __mbstate_t mbstate_t; __END_NAMESPACE_C99 -# define __mbstate_t_defined 1 #endif