Skip to content

Commit ae299c3

Browse files
committed
fix: make QEMU-VExpress-A9 example compatible with newlib 12.x by handling removed __sdidinit
1 parent ba795c6 commit ae299c3

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,12 @@ int rt_posix_stdio_set_console(const char* device_name, int mode)
104104
_GLOBAL_REENT->_stderr = std_console;
105105
}
106106

107-
#if (NEWLIB_VERSION_NUM < 30400U) || (NEWLIB_VERSION_NUM >= 40000U && NEWLIB_VERSION_NUM < 40300U)
108-
_GLOBAL_REENT->__sdidinit = 1; /* __sdidinit is obselete */
107+
#if defined(_REENT_SMALL) || !defined(__sdidinit)
108+
// newlib 新版本没有 __sdidinit
109+
#else
110+
_GLOBAL_REENT->__sdidinit = 1;
109111
#endif
112+
110113
}
111114

112115
if (std_console)

0 commit comments

Comments
 (0)