|
@@ -47,6 +47,8 @@ INIT_ENV_EXPORT(rt_posix_stdio_init);
|
|
|
|
|
|
#if defined(RT_USING_NEWLIBC)
|
|
|
|
|
|
+#define NEWLIB_VERSION_NUM (__NEWLIB__ * 10000U + __NEWLIB_MINOR__ * 100U + __NEWLIB_PATCHLEVEL__)
|
|
|
+
|
|
|
static FILE* std_console = NULL;
|
|
|
int rt_posix_stdio_set_console(const char* device_name, int mode)
|
|
|
{
|
|
@@ -102,7 +104,9 @@ int rt_posix_stdio_set_console(const char* device_name, int mode)
|
|
|
_GLOBAL_REENT->_stderr = std_console;
|
|
|
}
|
|
|
|
|
|
- _GLOBAL_REENT->__sdidinit = 1;
|
|
|
+#if (NEWLIB_VERSION_NUM < 30400U) || (NEWLIB_VERSION_NUM >= 40000U && NEWLIB_VERSION_NUM < 40300U)
|
|
|
+ _GLOBAL_REENT->__sdidinit = 1; /* __sdidinit is obselete */
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
if (std_console)
|