summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include')
-rw-r--r--newlib/libc/include/sys/reent.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 39785d77d..37fad56c1 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -149,8 +149,19 @@ struct __sFILE_fake {
struct _reent *_data;
};
-/* CHECK_STD_INIT() comes from stdio/local.h; be sure to include that. */
-# define _REENT_SMALL_CHECK_INIT(ptr) CHECK_STD_INIT(ptr)
+
+/* Following is needed both in libc/stdio and libc/stdlib so we put it
+ * here instead of libc/stdio/local.h where it was previously. */
+
+extern _VOID _EXFUN(__sinit,(struct _reent *));
+
+# define _REENT_SMALL_CHECK_INIT(ptr) \
+ do \
+ { \
+ if ((ptr) && !(ptr)->__sdidinit) \
+ __sinit (ptr); \
+ } \
+ while (0)
#else
# define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */
#endif