From 5d03067a3f4c3ead131f428f27c593cfbbc2b051 Mon Sep 17 00:00:00 2001 From: jonas Date: Wed, 1 Nov 2023 14:41:11 +0800 Subject: [PATCH] __sdidinit is obselete --- components/libc/posix/io/stdio/libc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/libc/posix/io/stdio/libc.c b/components/libc/posix/io/stdio/libc.c index ebdc3a5..74410d3 100644 --- a/components/libc/posix/io/stdio/libc.c +++ b/components/libc/posix/io/stdio/libc.c @@ -34,6 +34,7 @@ int libc_system_init(void) INIT_COMPONENT_EXPORT(libc_system_init); #if defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIB) +#define NEWLIB_VERSION_NUM (__NEWLIB__ * 10000U + __NEWLIB_MINOR__ * 100U + __NEWLIB_PATCHLEVEL__) #define STDIO_DEVICE_NAME_MAX 32 static FILE* std_console = NULL; int libc_stdio_set_console(const char* device_name, int mode) @@ -89,8 +90,9 @@ int libc_stdio_set_console(const char* device_name, int mode) _GLOBAL_REENT->_stdout = std_console; _GLOBAL_REENT->_stderr = std_console; } - +#if (NEWLIB_VERSION_NUM < 30400U) || (NEWLIB_VERSION_NUM >= 40000U && NEWLIB_VERSION_NUM < 40200U) _GLOBAL_REENT->__sdidinit = 1; +#endif } if (std_console)