Skip to content

Commit 2917180

Browse files
[libc][newlib] __sdidinit is obselete
related: #7923 mirror/newlib-cygwin@44b60f0 Co-authored-by: Meco Man <920369182@qq.com>
1 parent b08d867 commit 2917180

File tree

1 file changed

+5
-1
lines changed
  • components/libc/posix/io/stdio

1 file changed

+5
-1
lines changed

components/libc/posix/io/stdio/stdio.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ INIT_ENV_EXPORT(rt_posix_stdio_init);
4747

4848
#if defined(RT_USING_NEWLIBC)
4949

50+
#define NEWLIB_VERSION_NUM (__NEWLIB__ * 10000U + __NEWLIB_MINOR__ * 100U + __NEWLIB_PATCHLEVEL__)
51+
5052
static FILE* std_console = NULL;
5153
int rt_posix_stdio_set_console(const char* device_name, int mode)
5254
{
@@ -102,7 +104,9 @@ int rt_posix_stdio_set_console(const char* device_name, int mode)
102104
_GLOBAL_REENT->_stderr = std_console;
103105
}
104106

105-
_GLOBAL_REENT->__sdidinit = 1;
107+
#if (NEWLIB_VERSION_NUM < 30400U) || (NEWLIB_VERSION_NUM >= 40000U && NEWLIB_VERSION_NUM < 40300U)
108+
_GLOBAL_REENT->__sdidinit = 1; /* __sdidinit is obselete */
109+
#endif
106110
}
107111

108112
if (std_console)

0 commit comments

Comments
 (0)